[ADMB Users] quick, stupid question: retrieve standard errors for some parameters when bad hessian?
dave fournier
davef at otter-rsch.com
Thu Nov 3 09:49:55 PDT 2011
This turns out to be remarkably difficult and boring to deal with.
The idea is that first you fit the model and then check for very small
variances
tau1 and tau2. If one is small you make it inactive and then
calculate the
Hessian for the rest. Easiest is to run the model twice. Before running
it the first time
get rid of analyzer.par
rm analyzer.par
./analyzer -ind analyzer.dat -mno 100000 -gbs 200000000 -cbs 100000000
-nohess
./analyzer -ind analyzer.dat -mno 100000 -gbs 200000000 -cbs 100000000
-phase 10 -ainp analyzer.par
grep "beta2" *.std >> b1
This extra code is added to the model to determine what variables to
turn off
DATA_SECTION
init_int n
int lflag1
int lflag2
init_matrix x(1,n,1,3)
init_matrix Y(1,n,1,3)
LOC_CALCS
lflag1=2;
lflag2=2;
double lt1,lt2;
lt1=0;
lt2=0;
cifstream cif("analyzer.par");
if (!(!cif))
{
cif >> lt1 >> lt2;
if (lt1<-3.9)
lflag1=-1;
if (lt2<-3.9)
lflag2=-1;
}
and
init_bounded_number log_tau1(-4.0,4.0,lflag1)
init_bounded_number log_tau2(-4.0,4.0,lflag2)
I attached the tpl file for the modified model.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: analyzer.tpl
URL: <http://lists.admb-project.org/pipermail/users/attachments/20111103/fea13ccf/attachment.ksh>
More information about the Users
mailing list