seacode / gmacs

A generic size-structured stock assessment model
https://seacode.github.io/gmacs
18 stars 14 forks source link

"Add CV" approach #156

Closed jimianelli closed 8 years ago

jimianelli commented 8 years ago

suggestion from Jie: In GMACS.tpl: About line 669, add: Init_vector cv_phz(1, nSurveys);

About line 1021, add: Init_number_vector add_cv(1, nSurveys,-1.0,1.0,cv_phz);

About line 2521-2522,replace by: dvector cpue_sd(k) = sqrt(log(1.0 + square(cpue_cv(k)+add_cv(k)))); nloglike(2,k) +=cpue_lambda(k) * (sum(log(cpeu_sd(k)))+dnorm(res_cpue(k), cpue_sd(k)));

In SM15.ctl (and other control files) : After line 90, add: Additional CV phase for survey/indices -4 -4 (or 4 4 for estimating)

jimianelli commented 8 years ago

When the code is implemented, I'll test / fix other example models to ensure they contain the correct lines, also for the simulation models.

wStockhausen commented 8 years ago

I think dvector in dvector cpue_sd(k) = sqrt(log(1.0 + square(cpue_cv(k)+add_cv(k)))); Should be declared as dvar vector, shouldn't it?

On Thursday, December 17, 2015, Jim Ianelli notifications@github.com wrote:

suggestion from Jie: In GMACS.tpl: About line 669, add: Init_vector cv_phz(1, nSurveys);

About line 1021, add: Init_number_vector add_cv(1, nSurveys,-1.0,1.0,cv_phz);

About line 2521-2522,replace by: dvector cpue_sd(k) = sqrt(log(1.0 + square(cpue_cv(k)+add_cv(k)))); nloglike(2,k) +=cpue_lambda(k) * (sum(log(cpeu_sd(k)))+dnorm(res_cpue(k), cpue_sd(k)));

In SM15.ctl (and other control files) : After line 90, add: Additional CV phase for survey/indices -4 -4 (or 4 4 for estimating)

— Reply to this email directly or view it on GitHub https://github.com/seacode/gmacs/issues/156.


quantifish commented 8 years ago

Yes, right you are thanks Buck. I just got this finished off using the smbkc example, I shall push now. Thanks also to Jie!

jimianelli commented 8 years ago

Adding some output ~2806 to show result of this and note that line 2570 doesn't seem correct: nloglike(2,k) += cpue_lambda(k) * (log(cpue_sd(k)) + dnorm(res_cpue(k), cpue_sd));

since cpue_sd(k) is a vector for the kth survey dvar_vector cpue_sd = sqrt(log(1.0 + square(cpue_cv(k) + add_cv(k))));

quantifish commented 8 years ago

Thanks Jim. It also occurred to me that we will need to specify priors for additional CV.

jimianelli commented 8 years ago

priors...and also always positive...

quantifish commented 8 years ago

done