I think there is a bit lost in translation here.
>I fixed the parameters and simulate Y to test the ADMB script. The
>parameters have exactly (and amazingly!) the same values as I fixed >(which
>is not the case when using optim function in R or fminsearch in matlab and
>it's much longer).
Do you mean the you used known parameters to simulate some data and then
fit the data and got the parameters back. Is that the same data set
for which the results you posted here are from? anyway if you send me
the tpl file and every thing needed to run the model I'll take a look at it.
David A. Fournier
P.O. Box 2040,
Sidney, B.C. V8l 3S3
Users mailing list
Kd=elem_prod(Kd,exp(.01*tmp)); // add some lognormal noise to Kd
However with real data you may need to civilize the code a bit.
situation. very unlikely that this will occur with real data.
If you are moving on to random effects you should first civilize the
model a bit. In somethng like
exp( a(1) + a(2)*v + a(3)*v^2 )
you should at least center v as in
w = v -mean(v)
mfexp( a(1) + a(2)*w + a(3)*w^2 )
The use of mfexp is to avoid overflow.
also you might fit a(1) first as in
init_number a1 // fit in phase 1
init_vector a(2,3,2) .. fit in phase 2
mfexp( a1 + a(2)*w + a(3)*w^2 )
Thanks guys. It runs well now with both methods you mentioned. I seems
like it is not good to have perfect data! I gonna try the random effect
2009/4/9 Mark Maunder <mmau...@iattc.org>
I see that Dave found that it was related to having no error in the
simulated data. I guess if you fixed the standard deviation (use a
negative phase) it might work without adding error.
From: Sylvain Bonhommeau [mailto:sylvain.b...@gmail.com]
Sent: Thursday, April 09, 2009 8:39 AM
To: Mark Maunder
Subject: Re: [ADMB Users] "Hessian does not appear to be positive
Thanks for your answer.
I simulated the data with R (code below). There is no error added to
data for now but that is the aim of today. I specified a pin file and
the initial conditions are not (but close to) the "known" parameters.
I think we should keep this on the list as these are issures whihc may
What you are coming up against here are the limits of estimability.
If you remove the std dev from the model and just fit the least squares
calculate the mean-squared residuals you will get 0.000821022 so the model
fits the data almost perfectly. the fact that they are not the values
to generate the data simply reflects the fact that there is not a lot of
information in the data
i.e. thee are different combinations of the model parameters which fit
the model (almost) equally well.
> I want to test the ability of my procedure to estimate parameters so I
> simulated data with known parameters. As you mentioned previously,
> when there is no errors, it is not possible to get the standard
> deviation. However in the .par file, the value of parameters are
> almost perfect. The problem is when I add a small noise to my
> simulated data, i.e. multiplying by a random variable normally
> distributed with mean=1 and sd=0.01, the estimated parameters are not
> the one I chose...
> I attach the .tpl, .pin and the two .dat file (without and with error)
> as well as the R script to simulate the data.
> (this is a simplified version of the model I sent you before)
> Thanks for your help,
> 2009/4/9 dave fournier <ot...@otter-rsch.com