LSSTDESC / qp

Quantile Parametrization for probability distribution functions module
MIT License
10 stars 3 forks source link

New parameterization(s) for CLMM n(z) #76

Open aimalz opened 2 years ago

aimalz commented 2 years ago

The CLMM team is manually handling n(z) parameterizations, both idealized analytic parameterizations for mock data generation and realistically complex distributions. This issue is for ensuring that qp supports

  1. the analytic parameterization(s) used in CL forecasting and
  2. methods enabling the mathematical operations performed in the CL pipelines.

(The next step will be to convert to the use of qp in both the modeling and analysis use cases using issues/PRs in the CLMM repo.)

Please do comment with links to relevant code @marina-ricci @m-aguena!

m-aguena commented 2 years ago

There is also some code in CLMM's branch 443 here that is handeling some photo-z integration. In particular, the function _integ_pzfuncs that integrates the PDZ of a source sample that can have a different binning per object. I believe PR460 will be merged soon and this will become part of the main code.

eacharles commented 2 years ago

I'm not understanding what is being asked for here, i.e., what specific represenation of the pdfs you would like.
Keep in mind that the scipy stats interface will let you call cdf() to get the integral of whatever representation you want.

aimalz commented 2 years ago

The functional form seems to be

if is_cdf:
        return redshift0**(alpha+1)*gammainc((alpha+1)/beta, (redshift/redshift0)**beta)/beta*gamma((alpha+1)/beta)
else:
        return (redshift**alpha)*np.exp(-(redshift/redshift0)**beta)

from CLMM's mock data module. I think that means the desired functionality could satisfied by the scipy generalized gamma distribution already accessible through qp, with a bit of a transformation on the CLMM function's input parameters of alpha, beta, and redshift0 to take the right form. @m-aguena @marina-ricci Is this an accurate assessment of the parameterization in question?