[ADMB Users] sdreport variables in SEPERABLE_FUNCTIONs
dave fournier
davef at otter-rsch.com
Tue Mar 6 12:19:27 PST 2012
This seems to do the job
DATA_SECTION
PARAMETER_SECTION
init_number x
sdreport_number y
random_effects_vector v(1,1);
objective_function_value f
PROCEDURE_SECTION
f1(x,v(1));
if (sd_phase())
y=x+v(1);
SEPARABLE_FUNCTION void f1( const prevariable& x, const prevariable& vi)
f+=0.5*square(x-1.0)+0.5*vi*vi;
STD file is
index name value std dev
1 x 1.0002e+00 1.0000e+00
2 v 0.0000e+00 1.0000e+00
3 y 1.0002e+00 1.4142e+00
More information about the Users
mailing list