- #1
BrunoMota
- 3
- 0
Hello, I'm new to the world of "numerical" astronomy/cosmology and I've been studying maximum likelihood estimation for model tests. The (analytical) theory is somewhat easy to understand, but I've been struggling with the numerical aspect of the computations.
Suppose you have some model with a given number of free parameters (say, 3 for simplicity) and you're given an array of (N) observed values (along with the respective deviations).
What I'm trying to do is to graph the 2D/1D likelihood contours. I've been recommended to first calculate de chi-square sum:
$$ \chi^2 = \sum_{i}^{N} \left(\frac{y_i - y_i(a_1,a_2,a_3) }{\sigma _i }\right)^2 $$
where $$ a_1,a_2,a_3 $$ are my free parameters.
The the likelihood is given by:
$$ L = e^{-\chi^2/2} $$
My problem is the numerical aspect of this. How do I convert the chi-square into a matrix form and after I get the likelihood matrix how do I graph the countours?
Also because want the 2D/1D likelihood contours I'll have to marginalize but obviously I can not integrate since this is a not an analytical problem. How should I do this.
Thanks in advance!
Suppose you have some model with a given number of free parameters (say, 3 for simplicity) and you're given an array of (N) observed values (along with the respective deviations).
What I'm trying to do is to graph the 2D/1D likelihood contours. I've been recommended to first calculate de chi-square sum:
$$ \chi^2 = \sum_{i}^{N} \left(\frac{y_i - y_i(a_1,a_2,a_3) }{\sigma _i }\right)^2 $$
where $$ a_1,a_2,a_3 $$ are my free parameters.
The the likelihood is given by:
$$ L = e^{-\chi^2/2} $$
My problem is the numerical aspect of this. How do I convert the chi-square into a matrix form and after I get the likelihood matrix how do I graph the countours?
Also because want the 2D/1D likelihood contours I'll have to marginalize but obviously I can not integrate since this is a not an analytical problem. How should I do this.
Thanks in advance!