wale.RateFunction module
- wale.RateFunction.get_phi_projec_2cell(theta1, theta2, zarr, chis, dchis, w, y, recal, variance, **kwargs)[source]
Compute projected 2-cell φ(y) by solving saddle-point equations.
- Parameters:
theta1 (float) – Angular scales of the two cells.
theta2 (float) – Angular scales of the two cells.
zarr (ndarray) – Redshifts at which to evaluate.
chis (ndarray) – Comoving distances corresponding to redshifts.
dchis (float) – Integration step size in χ.
w (ndarray) – Lensing weight function W(χ).
y (ndarray) – Slope values for SCGF (y-grid).
recal (float) – Empirical recalibration factor.
variance (object) – Provides nonlinear_sigma2(χ) interface.
deld (float, optional) – Step size for finite differences (default: 1e-8).
- Returns:
phi_proj – Projected φ(y) values computed via saddle-point approximation.
- Return type:
ndarray
- wale.RateFunction.get_psi_2cell(variance, chi, recal, z, delta1, delta2, theta1, theta2)[source]
Compute the 2-cell action ψ(δ₁, δ₂) using large-deviation theory.
- Parameters:
variance (object) – Object providing nonlinear_sigma2 method for computing variances.
chi (float or ndarray) – Comoving distance(s).
recal (float) – Empirical recalibration factor.
z (float) – Redshift.
delta1 (float) – Density contrasts in each cell.
delta2 (float) – Density contrasts in each cell.
theta1 (float) – Angular scales of the two cells.
theta2 (float) – Angular scales of the two cells.
- Returns:
psi – Value of the large-deviation action ψ(δ₁, δ₂).
- Return type:
float
- wale.RateFunction.get_psi_2nd_derivative_delta1(deld, variance, chi, recal, z, delta1, delta2, theta1, theta2)[source]
Compute ∂²ψ/∂δ₁² using second-order central finite differences.
- Returns:
second_derivative – Second partial derivative of ψ with respect to δ₁.
- Return type:
float
- wale.RateFunction.get_psi_2nd_derivative_delta2(deld, variance, chi, recal, z, delta1, delta2, theta1, theta2)[source]
Compute ∂²ψ/∂δ₂² using second-order central finite differences.
- Returns:
second_derivative – Second partial derivative of ψ with respect to δ₂.
- Return type:
float
- wale.RateFunction.get_psi_derivative_delta1(deld, variance, chi, recal, z, delta1, delta2, theta1, theta2)[source]
Compute ∂ψ/∂δ₁ using central finite differences.
- Returns:
derivative – Numerical partial derivative of ψ with respect to δ₁.
- Return type:
float
- wale.RateFunction.get_psi_derivative_delta2(deld, variance, chi, recal, z, delta1, delta2, theta1, theta2)[source]
Compute ∂ψ/∂δ₂ using central finite differences.
- Returns:
derivative – Numerical partial derivative of ψ with respect to δ₂.
- Return type:
float
- wale.RateFunction.get_psi_mixed_derivative_delta1_delta2(deld, variance, chi, recal, z, delta1, delta2, theta1, theta2)[source]
Compute the mixed partial derivative ∂²ψ/∂δ₁∂δ₂ using central differences.
- Returns:
mixed_derivative – Mixed second-order partial derivative of ψ.
- Return type:
float
- wale.RateFunction.get_scaled_cgf(theta1, theta2, zarr, chis, dchis, lensing_weight, y, recal, variance)[source]
Wrapper to compute the scaled cumulant generating function (SCGF).
- Parameters:
theta1 (float) – Angular scales.
theta2 (float) – Angular scales.
zarr (ndarray) – Redshift values.
chis (ndarray) – Comoving distances.
dchis (float) – Integration step size.
lensing_weight (ndarray) – Lensing kernel W(χ).
y (ndarray) – SCGF slope values.
recal (float) – Recalibration factor.
variance (object) – Provides nonlinear sigma²(R₁, R₂, z).
- Returns:
scgf – The scaled cumulant generating function φ(y).
- Return type:
ndarray
- wale.RateFunction.get_tau(rho)[source]
Compute the large-deviation theory mapping τ(ρ) for a given density contrast ρ.
- Parameters:
rho (float or array_like) – Local density ρ = 1 + δ.
- Returns:
tau – The corresponding τ(ρ) value based on the ν parameter.
- Return type:
float or ndarray
- wale.RateFunction.psi_derivative_determinant(deld, delta1, delta2, z, variance, chi, recal, theta1, theta2)[source]
Compute the determinant of the Hessian matrix of ψ(δ₁, δ₂):
det(H) = ∂²ψ/∂δ₁² * ∂²ψ/∂δ₂² − (∂²ψ/∂δ₁∂δ₂)²
This determinant is used for computing the normalization in saddle-point approximations.
- Returns:
result – Determinant of the ψ Hessian matrix.
- Return type:
float