Re: maximum likelihood fitting with prior [message #83967 is a reply to message #83955] |
Tue, 16 April 2013 07:22   |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
On Monday, April 15, 2013 4:19:41 PM UTC-4, Craig Markwardt wrote:
> On Monday, April 15, 2013 9:48:10 AM UTC-4, rrya...@gmail.com wrote:
>
>> Err, I guess I want maximum posterior fitting. I have some data to which I want to fit a very complex and highly non-linear model, but I have some priors on the parameters of the model. I used to have no priors (err, I guess flat priors) and in which case the problem was a simple "chi-2", and I was successfully using C. Markwardt's mpfit. It worked mostly great, but I had to do some experimentation to ensure I was avoiding local extrema. However, with the prior I cannot write a function that returns an array of the form:
>
>
>
> What is the nature of the prior information? If it's simply that you have an a priori parameter value with a priori (gaussian) uncertainty, then that's easy. If you have a covariance matrix, or non-gaussian prior distribution, well then it gets harder.
>
>
>
> Craig
Grr... That's what I was afraid of. No, the prior not a simple multi-variate Gaussian --- nor can I even approximate it as such. In some cases it's an exponential distribution, and other complex things. I've done a few quick tests to see if using tnmin would work, and I'm going to go larger scale. Maybe you can correct me if I'm way off base.
(0) initialize with some random point
(1) pass the parameters of the prior into the function (that tnmin will call) via a common block.
(2) evaluate the likelihood. In this case that's a simple chi2. But, then I'll add the prior (again, I'm working with log-probabilities).
(3) return that as the cost function.
(4) let tnmin iterate.
(5) goto (0) with a different input.
(6) collate all the results from the (0)-(5) iterative process and keep the best fit (ie. best over the many iterations between 0-5).
Whaddya think?
-Russell
|
|
|