Likelihood module#
The asteca.Likelihood
class is used to define an object that can
compute how similar your observed cluster is, stored in
a asteca.Cluster
object, compared to a given
synthetic cluster, generated by the asteca.Synthetic.generate()
method.
This basically compares observed photometry versus synthetic photometry.
Currently, the only function implemented is the Poisson likelihood ratio, as described below. The user can of course choose to implement their own likelihood functions, but this one is recommended because it is thoroughly tested, well documented, and has been used in the literature. It is also the one used in the examples and tutorials provided in this documentation.
To define a asteca.Likelihood
object, we need to provide a
asteca.Cluster
object which will be used to calibrate the likelihood
function:
# Define a likelihood object
likelihood = asteca.Likelihood(my_cluster)
After this, we can evaluate the likelihood of a given synthetic cluster
using the asteca.Likelihood.get()
method:
# Generate an array with synthetic data, as described in previous sections
synth_cluster_arr = synthcl.generate(params)
# Evaluate versus a synthetic cluster
lkl = likelihood.get(synth_cluster_arr)
The result is a normalized and inverted likelihood which serves as a distance
measure between the observed and the synthetic data, where the best value is then 0
.
Poisson likelihood ratio#
This is the Posson likelihood ratio as defined in Tremmel et al (2013). Starting from Eq 10 with \(v_{i,j}=1\) (i.e.: equal volumes for all cells), we have:
where \(n_i\) and \(m_i\) are the number of observed and synthetic stars in bin \(i\), respectively, and \(B\) is the total number of bins. Applying the logarithm:
re-arranging:
defining the \(LogGamma()\) function:
We can discard the last two terms as they depend on \(n_i\) only (i.e.: the observed cluster), and hence do not change for different synthetic data.
The last term \(M\) is the total number of synthetic stars. This value is fixed
in the arrays of synthetic data generated by asteca.Synthetic.generate()
,
and thus we can also discard it.
Important
The fact that \(M\) is fixed is true due to how ASteCA generates synthetic clusters. This might not be the case for other implementations.
Finally, discarding the last three terms, we have the expression for the Poisson likelihood ratio: