Statistics#

s2scat.utility.statistics.add_to_C01(C01: List[float64], Nj1j2: Array, W: Array, Q: Array) List[float64]#

Computes the fourth order covariance statistic \(\text{C01}_j = \text{Cov}\big [ \Psi^{\lambda_1} f, \Psi^{\lambda_1} | \Psi^{\lambda_2} f | \big ]\) at scale \(j\).

Parameters:
  • C01 (List[jnp.float64]) – List in which to append the fourth order covariance statistic.

  • Nj1j2 (List[jnp.ndarray]) – Second order wavelet coefficients at scale \(j\).

  • W (jnp.ndarray) – Spherical signal at a single scale \(j\).

  • Q (List[jnp.ndarray]) – Quadrautre weights of given sampling pattern at scale \(j\).

Returns:

List into which \(\text{C01}_j\) has been appended.

Return type:

List[jnp.float64]

s2scat.utility.statistics.add_to_C11(C11: List[float64], Nj1j2: Array, Q: Array) List[float64]#

Computes the sixth order covariance statistic \(\text{C11}_j = \text{Cov}\big [ \Psi^{\lambda_1} | \Psi^{\lambda_3} f |, \Psi^{\lambda_1} | \Psi^{\lambda_2} f | \big ]\) at scale \(j\).

Parameters:
  • C11 (List[jnp.float64]) – List in which to append the sixth order covariance statistic.

  • Nj1j2 (List[jnp.ndarray]) – Second order wavelet coefficients at scale \(j\).

  • Q (List[jnp.ndarray]) – Quadrautre weights of given sampling pattern at scale \(j\).

Returns:

List into which \(\text{C11}_j\) has been appended.

Return type:

List[jnp.float64]

s2scat.utility.statistics.add_to_P00(P00: List[float64], W: Array, Q: Array) List[float64]#

Computes the second order power statistic \(\text{P00}_j = \langle |\Psi^\lambda f|^2 \rangle\) at scale \(j\).

Parameters:
  • P00 (List[jnp.float64]) – List in which to append the second order power statistic.

  • W (jnp.ndarray) – Spherical signal at a single scale \(j\).

  • Q (List[jnp.ndarray]) – Quadrautre weights of given sampling pattern at scale \(j\).

Returns:

List into which \(\text{P00}_j\) has been appended.

Return type:

List[jnp.float64]

s2scat.utility.statistics.add_to_S1(S1: List[float64], Mlm: Array, L: int) List[float64]#

Computes the mean field statistic \(\text{S1}_j = \langle |\Psi^\lambda f| \rangle\) at scale \(j\).

Parameters:
  • S1 (List[jnp.float64]) – List in which to append the mean field statistic.

  • Mlm (jnp.ndarray) – Spherical harmonic coefficients, batched at index 0 over directionality.

  • L (int) – Spherical harmonic bandlimit.

Returns:

List into which \(\text{S1}_j\) has been appended.

Return type:

List[jnp.float64]

s2scat.utility.statistics.compute_C01_and_C11(Nj1j2: List[Array], W: List[Array], Q: List[Array], J_min: int, J_max: int) Tuple[Array]#

Compute the fourth (C01) and sixth (C11) order covariances.

Parameters:
  • Nj1j2 (List[jnp.ndarray]) – Multiscale second order wavelet coefficients.

  • W (List[jnp.ndarray]) – Multiscale first order wavelet coefficients.

  • Q (List[jnp.ndarray]) – Multiscale quadrautre weights of given sampling pattern.

  • J_min (int) – Minimum dyadic wavelet scale to consider.

  • J_max (int) – Maximum dyadic wavelet scale to consider.

Returns:

Fourth and sixth order scattering covariance statistics.

Return type:

Tuple[jnp.ndarray]

Notes

The fourth order statistic \(\text{C01} = \text{Cov}\big [ \Psi^{\lambda_1} f, \Psi^{\lambda_1} | \Psi^{\lambda_2} f | \big ]\) can be seen as the covariance between power on scales \(\lambda_1=(j_1,n_1)\) and \(\lambda_2=(j_2,n_2)\), and is hence a fourth order statistic which is sensitive to directional multiscale structure, e.g. filaments. C11 behaves similarly, but correlates between three scales and directions and is consequently sixth order.

s2scat.utility.statistics.compute_mean_variance(flm: Array, L: int) Tuple[float64]#

Computes the mean and variance of a spherical signal.

Parameters:
  • flm (jnp.ndarray) – Spherical harmonic coefficients.

  • L (int) – Spherical harmonic bandlimit.

Returns:

mean and variance of provided signal in harmonic space.

Return type:

Tuple[jnp.float64]

Notes

The mean of a spherical signal can easily be read off from the harmonic coefficients as the the mean is just the \(f_{00}\) coefficient. Here we choose to capture the variance in harmonic space for simplicity.

s2scat.utility.statistics.compute_pearson_correlation(target: Array, predict: Array) float64#

Computes the recovered signal pearson correlation coefficient (structural similarity).

Parameters:
  • target (jnp.ndarray) – Ground truth signal.

  • predict (jnp.ndarray) – Estimated/recovered signal.

Returns:

Pearson correlation coefficient.

Return type:

jnp.float64

s2scat.utility.statistics.compute_snr(target: Array, predict: Array) float64#

Computes the recovered signal to noise ratio (SNR) in dB.

Parameters:
  • target (jnp.ndarray) – Ground truth signal.

  • predict (jnp.ndarray) – Estimated/recovered signal.

Returns:

Signal to noise ratio (dB)

Return type:

jnp.float64

s2scat.utility.statistics.normalize_map(f: Array) Array#

Normalises a spherical map by removing the mean and enforcing unit variance.

Parameters:

f (jnp.ndarray) – Signal on the sphere.

Returns:

Spherical signal with zero mean and unit variance.

Return type:

jnp.ndarray