1
1
#define TMB_LIB_INIT R_init_wham
2
2
#include < TMB.hpp>
3
3
#include < iostream>
4
- #include " helper_functions.hpp"
5
- #include " age_comp_osa.hpp"
6
- #include " age_comp_sim.hpp"
4
+ // #include "helper_functions.hpp"
5
+ // #include "age_comp_osa.hpp"
6
+ // #include "age_comp_sim.hpp"
7
7
8
8
template <class Type >
9
9
Type objective_function<Type>::operator () ()
@@ -12,7 +12,7 @@ Type objective_function<Type>::operator() ()
12
12
13
13
DATA_INTEGER (n_years_catch); // same as n_years_model
14
14
DATA_INTEGER (n_years_indices); // same as n_years_model
15
- DATA_INTEGER (n_years_model);
15
+ DATA_INTEGER (n_years_model);
16
16
DATA_INTEGER (n_ages);
17
17
DATA_INTEGER (n_fleets);
18
18
DATA_INTEGER (n_indices);
@@ -55,7 +55,7 @@ Type objective_function<Type>::operator() ()
55
55
DATA_VECTOR (q_upper);
56
56
DATA_IVECTOR (use_q_prior);
57
57
DATA_VECTOR (logit_q_prior_sigma);
58
- DATA_IVECTOR (use_q_re); // n_indices, 0= no re, >0 = use re
58
+ DATA_IVECTOR (use_q_re); // n_indices, 0= no re, >0 = use re
59
59
DATA_MATRIX (selpars_lower);
60
60
DATA_MATRIX (selpars_upper);
61
61
DATA_INTEGER (n_NAA_sigma); // 0 = SCAA, 1 = logR only, 2 = full state-space with shared sig_a for a > 1
@@ -97,7 +97,7 @@ Type objective_function<Type>::operator() ()
97
97
DATA_IMATRIX (keep_E); // Ecov
98
98
DATA_IARRAY (keep_Cpaa);
99
99
DATA_IARRAY (keep_Ipaa);
100
- DATA_IVECTOR (do_post_samp); // length = 5, whether to ADREPORT posterior residuals for NAA, M, selectivity, Ecov, q.
100
+ DATA_IVECTOR (do_post_samp); // length = 5, whether to ADREPORT posterior residuals for NAA, M, selectivity, Ecov, q.
101
101
102
102
// data for environmental covariate(s), Ecov
103
103
DATA_INTEGER (n_Ecov); // also = 1 if no Ecov
@@ -130,7 +130,7 @@ Type objective_function<Type>::operator() ()
130
130
DATA_SCALAR (logR_mean); // empirical mean recruitment in model years, used for SCAA recruit projections
131
131
DATA_SCALAR (logR_sd); // empirical sd recruitment in model years, used for SCAA recruit projections
132
132
DATA_VECTOR (F_proj_init); // annual initial values to use for newton steps to find F for use in projections (n_years_proj)
133
-
133
+
134
134
// static brp info
135
135
DATA_INTEGER (which_F_age_static); // which age of F to use for full total F for static brps (max of average FAA_tot over avg_years_ind)
136
136
DATA_SCALAR (static_FXSPR_init); // initial value to use for newton steps to find FXSPR_static
@@ -174,7 +174,7 @@ Type objective_function<Type>::operator() ()
174
174
PARAMETER_ARRAY (Ecov_beta); // dim = (2 + n_indices) x n_poly x n_ecov x n_ages, beta_R in eqns 4-5, Miller et al. (2016)
175
175
PARAMETER_MATRIX (Ecov_process_pars); // nrows = RW: 2 par (Ecov1, sig), AR1: 3 par (mu, sig, phi); ncol = N_ecov
176
176
PARAMETER_MATRIX (Ecov_obs_logsigma); // N_Ecov_years x n_Ecov. options: just given (data), or fixed effect(s)
177
- PARAMETER_MATRIX (Ecov_obs_logsigma_re); // N_Ecov_years x n_Ecov. columns of random effects used if Ecov_obs_sigma_opt = 4
177
+ PARAMETER_MATRIX (Ecov_obs_logsigma_re); // N_Ecov_years x n_Ecov. columns of random effects used if Ecov_obs_sigma_opt = 4
178
178
PARAMETER_MATRIX (Ecov_obs_sigma_par); // ncol = N_Ecov, nrows = 2 (mean, sigma of random effects)
179
179
180
180
Type nll= 0.0 ; // negative log-likelihood
@@ -246,7 +246,7 @@ Type objective_function<Type>::operator() ()
246
246
sigma = exp (sel_repars (b,0 ));
247
247
rho = rho_trans (sel_repars (b,1 )); // rho_trans ensures correlation parameter is between -1 and 1, see helper_functions.hpp
248
248
rho_y = rho_trans (sel_repars (b,2 )); // rho_trans ensures correlation parameter is between -1 and 1, see helper_functions.hpp
249
-
249
+
250
250
if ((selblock_models_re (b) == 2 ) | (selblock_models_re (b) == 5 )){
251
251
// 2D AR1 process on selectivity parameter deviations
252
252
Sigma_sig_sel = pow (pow (sigma,2 ) / ((1 -pow (rho_y,2 ))*(1 -pow (rho,2 ))),0.5 );
@@ -255,20 +255,20 @@ Type objective_function<Type>::operator() ()
255
255
} else {
256
256
// 1D AR1 process on selectivity parameter deviations
257
257
if (selblock_models_re (b) == 3 ){ // ar1 across parameters in selblock, useful for age-specific pars.
258
- vector<Type> tmp0 = tmp.matrix ().row (0 ); // random effects are constant across years
258
+ vector<Type> tmp0 = tmp.matrix ().row (0 ); // random effects are constant across years
259
259
Sigma_sig_sel = pow (pow (sigma,2 ) / (1 -pow (rho,2 )),0.5 );
260
260
nll_sel += SCALE (AR1 (rho), Sigma_sig_sel)(tmp0);
261
- SIMULATE if (simulate_state (2 ) == 1 ) if (sum (simulate_period) > 0 )
261
+ SIMULATE if (simulate_state (2 ) == 1 ) if (sum (simulate_period) > 0 )
262
262
{
263
263
AR1 (rho).simulate (tmp0);
264
264
for (int y = 0 ; y < tmp.rows (); y++) for (int i = 0 ; i < tmp0.size (); i++) tmp (y,i) = tmp0 (i);
265
265
}
266
266
} else { // selblock_models_re(b) = 4, ar1_y, not sure if this one really makes sense.
267
- vector<Type> tmp0 = tmp.matrix ().col (0 ); // random effects are constant within years
267
+ vector<Type> tmp0 = tmp.matrix ().col (0 ); // random effects are constant within years
268
268
Sigma_sig_sel = pow (pow (sigma,2 ) / (1 -pow (rho_y,2 )),0.5 );
269
269
// Sigma_sig_sel = sigma;
270
270
nll_sel += SCALE (AR1 (rho_y), Sigma_sig_sel)(tmp0);
271
- SIMULATE if (simulate_state (2 ) == 1 ) if (sum (simulate_period) > 0 )
271
+ SIMULATE if (simulate_state (2 ) == 1 ) if (sum (simulate_period) > 0 )
272
272
{
273
273
AR1 (rho_y).simulate (tmp0);
274
274
for (int a = 0 ; a < tmp.cols (); a++) tmp.col (a) = tmp0;
@@ -422,7 +422,7 @@ Type objective_function<Type>::operator() ()
422
422
REPORT (Ecov_obs_logsigma);
423
423
}
424
424
425
-
425
+
426
426
// Lag environmental covariates -------------------------------------
427
427
// Then use Ecov_out(t) for processes in year t, instead of Ecov_x
428
428
int n_effects = Ecov_beta.dim (0 ); // 2 + n_indices (recruitment, mortality and any catchabilities)
@@ -445,7 +445,7 @@ Type objective_function<Type>::operator() ()
445
445
// Ecov_lm.setZero();
446
446
// Ecov_lm stores the linear models for each Ecov and where it is used. dim = n_Ecov, n_effects, n_years_model + n_years_proj, n_ages
447
447
// n_effects dimension is: 0: recruitment, 1: M, 2-1+n_indices: which catchability it affects
448
- array<Type> Ecov_lm (n_Ecov, n_effects,n_years_model + n_years_proj, n_ages);
448
+ array<Type> Ecov_lm (n_Ecov, n_effects,n_years_model + n_years_proj, n_ages);
449
449
// vector<matrix<Type> > Ecov_lm(n_Ecov); // ecov linear model for each Ecov, dim = n_years_model + n_years_proj, n_ages
450
450
for (int i = 0 ; i < n_Ecov; i++){
451
451
for (int t = 0 ; t < n_effects; t++){
@@ -505,7 +505,7 @@ Type objective_function<Type>::operator() ()
505
505
M_re (y,i) = Mre0 (i);
506
506
}
507
507
}
508
- }
508
+ }
509
509
} else { // M_re_model = 4, 1D ar1_y
510
510
vector<Type> Mre0 = M_re.matrix ().col (0 );
511
511
Sigma_M = pow (pow (sigma_M,2 ) / (1 -pow (rho_M_y,2 )),0.5 );
@@ -537,7 +537,7 @@ Type objective_function<Type>::operator() ()
537
537
// Construct mortality-at-age (MAA)
538
538
matrix<Type> MAA (n_years_model + n_years_proj,n_ages);
539
539
if (M_model == 2 ){ // age-specific M
540
- for (int a = 0 ; a < n_ages; a++) for (int y = 0 ; y < n_years_model; y++) MAA (y,a) = exp (M_a (a) + M_re (y,a));
540
+ for (int a = 0 ; a < n_ages; a++) for (int y = 0 ; y < n_years_model; y++) MAA (y,a) = exp (M_a (a) + M_re (y,a));
541
541
} else {
542
542
if (M_model == 1 ){ // constant M
543
543
for (int a = 0 ; a < n_ages; a++) for (int y = 0 ; y < n_years_model; y++) MAA (y,a) = exp (M_a (0 ) + M_re (y,a));
@@ -546,8 +546,8 @@ Type objective_function<Type>::operator() ()
546
546
}
547
547
}
548
548
// add to MAA in projection years
549
- if (do_proj == 1 ){
550
- if (proj_M_opt == 2 ){ // use average MAA over avg.yrs
549
+ if (do_proj == 1 ){
550
+ if (proj_M_opt == 2 ){ // use average MAA over avg.yrs
551
551
matrix<Type> MAA_toavg (n_toavg,n_ages);
552
552
for (int a = 0 ; a < n_ages; a++){
553
553
for (int i = 0 ; i < n_toavg; i++){
@@ -560,7 +560,7 @@ Type objective_function<Type>::operator() ()
560
560
}
561
561
} else { // proj_M_opt == 1, use M_re and/or ecov_lm in projection years
562
562
if (M_model == 2 ){ // age-specific M
563
- for (int a = 0 ; a < n_ages; a++) for (int y = n_years_model; y < n_years_model + n_years_proj; y++) MAA (y,a) = exp (M_a (a) + M_re (y,a));
563
+ for (int a = 0 ; a < n_ages; a++) for (int y = n_years_model; y < n_years_model + n_years_proj; y++) MAA (y,a) = exp (M_a (a) + M_re (y,a));
564
564
} else {
565
565
if (M_model == 1 ){ // constant M
566
566
for (int a = 0 ; a < n_ages; a++) for (int y = n_years_model; y < n_years_model + n_years_proj; y++) MAA (y,a) = exp (M_a (0 ) + M_re (y,a));
@@ -605,17 +605,17 @@ Type objective_function<Type>::operator() ()
605
605
matrix<Type> logit_q_mat (n_years_model+n_years_proj, n_indices);
606
606
logit_q_mat.setZero ();
607
607
for (int i = 0 ; i < n_indices; i++) {
608
-
608
+
609
609
// use prior for q? q_prior_re are random effects with mean logit_q (fixed) and sd = logit_q_prior_sigma.
610
- if (use_q_prior (i) == 1 ){
610
+ if (use_q_prior (i) == 1 ){
611
611
nll_q_prior (i) -= dnorm (q_prior_re (i), logit_q (i), logit_q_prior_sigma (i), 1 );
612
612
SIMULATE if (simulate_state (4 ) == 1 ) if (sum (simulate_period) > 0 ){
613
613
q_prior_re (i) = rnorm (logit_q (i), logit_q_prior_sigma (i));
614
- }
614
+ }
615
615
for (int y = 0 ; y < n_years_model + n_years_proj; y++) logit_q_mat (y,i) += q_prior_re (i);
616
616
}
617
617
else for (int y = 0 ; y < n_years_model + n_years_proj; y++) logit_q_mat (y,i) += logit_q (i);
618
-
618
+
619
619
if (use_q_re (i) > 0 ) // random effects on q, q_re = AR1 deviations on (year,age), dim = n_years x n_M_a
620
620
{
621
621
sigma_q (i) = exp (q_repars (i,0 )); // conditional sd
@@ -854,7 +854,7 @@ Type objective_function<Type>::operator() ()
854
854
REPORT (SR_h_tf);
855
855
REPORT (log_SR_R0);
856
856
}
857
-
857
+
858
858
// ---------------------------------------------------------------------------------
859
859
// Population model (get NAA, numbers-at-age, for all years)
860
860
array<Type> NAA_devs (n_years_model+n_years_proj-1 , n_ages);
@@ -863,8 +863,8 @@ Type objective_function<Type>::operator() ()
863
863
864
864
for (int y = 1 ; y < n_years_model + n_years_proj; y++)
865
865
{
866
-
867
- pred_NAA.row (y) = get_pred_NAA_y (y, recruit_model, mean_rec_pars, SSB, NAA, log_SR_a,
866
+
867
+ pred_NAA.row (y) = get_pred_NAA_y (y, recruit_model, mean_rec_pars, SSB, NAA, log_SR_a,
868
868
log_SR_b, Ecov_where, Ecov_how, Ecov_lm, ZAA);
869
869
if ((y > n_years_model-1 ) & (proj_R_opt ==2 )) {// pred_R in projections == R used for spr-based BRPs. makes long term projections consistent
870
870
vector<Type> Rproj = get_R_FXSPR (pred_NAA, NAA, XSPR_R_opt, XSPR_R_avg_yrs);
@@ -878,7 +878,7 @@ Type objective_function<Type>::operator() ()
878
878
// calculate mean-0 deviations of log NAA (possibly bias-corrected)
879
879
for (int a = 0 ; a < n_ages; a++) NAA_devs (y-1 ,a) = log_NAA (y-1 ,a) - log (pred_NAA (y,a));
880
880
} else { // only recruitment estimated (either fixed or random effects)
881
- for (int a = 1 ; a < n_ages; a++) NAA (y,a) = pred_NAA (y,a); // for ages > 1 survival is deterministic
881
+ for (int a = 1 ; a < n_ages; a++) NAA (y,a) = pred_NAA (y,a); // for ages > 1 survival is deterministic
882
882
if ((n_NAA_sigma == 0 ) && (y > n_years_model-1 )){ // recruit FE, but recruit RE in projection years
883
883
NAA (y,0 ) = exp (logR_proj (y-n_years_model)); // SCAA recruit in projections use diff object (random effect)
884
884
for (int a = 1 ; a < n_ages; a++) NAA_devs (y-1 ,a) = log (NAA (y,a)) - log (pred_NAA (y,a));
@@ -888,16 +888,16 @@ Type objective_function<Type>::operator() ()
888
888
for (int a = 0 ; a < n_ages; a++) NAA_devs (y-1 ,a) = log (NAA (y,a)) - log (pred_NAA (y,a));
889
889
}
890
890
}
891
-
891
+
892
892
// calculate F and Z in projection years, here bc need NAA(y) if using F from catch
893
893
if (do_proj == 1 ){ // now need FAA by fleet for projections, use total of average FAA by fleet over avg.yrs
894
894
// get selectivity using average over avg.yrs
895
895
if (y > n_years_model-1 ){
896
896
waacatch = get_waacatch_y (waa, y, n_ages, waa_pointer_fleets);
897
897
waassb = get_waa_y (waa, y, n_ages, waa_pointer_ssb);
898
- // n_fleets x n_ages: projected full F is sum of (means across years at age) across fleets
899
- matrix<Type> FAA_proj = get_F_proj (y, n_fleets, proj_F_opt, FAA, NAA, MAA, mature, waacatch, waassb, fracyr_SSB,
900
- log_SPR0, avg_years_ind, n_years_model, which_F_age, percentSPR, proj_Fcatch, percentFXSPR, F_proj_init (y-n_years_model),
898
+ // n_fleets x n_ages: projected full F is sum of (means across years at age) across fleets
899
+ matrix<Type> FAA_proj = get_F_proj (y, n_fleets, proj_F_opt, FAA, NAA, MAA, mature, waacatch, waassb, fracyr_SSB,
900
+ log_SPR0, avg_years_ind, n_years_model, which_F_age, percentSPR, proj_Fcatch, percentFXSPR, F_proj_init (y-n_years_model),
901
901
log_SR_a, log_SR_b, recruit_model, percentFMSY, sigma_a_sig_brps);
902
902
FAA_tot.row (y) = FAA_proj.colwise ().sum ();
903
903
for (int f = 0 ; f < n_fleets; f++) for (int a = 0 ; a < n_ages; a++) FAA (y,f,a) = FAA_proj (f,a);
@@ -951,7 +951,7 @@ Type objective_function<Type>::operator() ()
951
951
NAA_devs (y,0 ) = NAAdevs0 (y);
952
952
} else if (bias_correct_pe == 1 ) { // need to subtract bias-correction off of NAA_devs
953
953
NAA_devs (y,0 ) -= 0.5 *pow (sigma_a_sig (0 ),2 );
954
- }
954
+ }
955
955
}
956
956
}
957
957
}
@@ -975,14 +975,14 @@ Type objective_function<Type>::operator() ()
975
975
NAA_devs (y,a) = NAAdevs (y,a);
976
976
} else if (bias_correct_pe == 1 ) { // need to subtract bias-correction off of NAA_devs
977
977
NAA_devs (y,a) -= 0.5 *pow (sigma_a_sig (a),2 );
978
- }
978
+ }
979
979
}
980
980
}
981
981
} else { // decoupling Recruitment random effects from ages 2+, like SAM?
982
982
Type NAA_rho_y_plus = rho_trans (trans_NAA_rho (2 )); // allow different rho_y for older ages
983
983
984
984
array<Type> NAA_devs_plus (NAA_devs.dim (0 ),NAA_devs.dim (1 )-1 );
985
- vector<Type> sigma_a_sig_plus = sigma_a_sig.segment (1 ,n_ages-1 );
985
+ vector<Type> sigma_a_sig_plus = sigma_a_sig.segment (1 ,n_ages-1 );
986
986
for (int a = 1 ; a < n_ages; a++) NAA_devs_plus.col (a-1 ) = NAA_devs.col (a);
987
987
if (bias_correct_pe == 1 ) for (int a = 1 ; a < n_ages; a++) NAA_devs_plus.col (a-1 ) += 0.5 *pow (sigma_a_sig (a),2 );
988
988
nll_NAA += SEPARABLE (VECSCALE (AR1 (NAA_rho_a), sigma_a_sig_plus),AR1 (NAA_rho_y_plus))(NAA_devs_plus);
@@ -1002,18 +1002,18 @@ Type objective_function<Type>::operator() ()
1002
1002
NAA_devs (y,a) = NAAdevsplus (y,a-1 );
1003
1003
} else if (bias_correct_pe == 1 ) { // need to subtract bias-correction off of NAA_devs
1004
1004
NAA_devs (y,a) -= 0.5 *pow (sigma_a_sig (a),2 );
1005
- }
1005
+ }
1006
1006
}
1007
1007
}
1008
1008
}
1009
1009
}
1010
1010
if ((n_NAA_sigma > 0 ) | (do_proj == 1 )) SIMULATE if (simulate_state (0 ) == 1 ){ // if n_NAA_sigma = 0 (SCAA), recruitment now random effects in projections
1011
- matrix<Type> sims = sim_pop (NAA_devs, recruit_model, mean_rec_pars, SSB, NAA, log_SR_a, log_SR_b, Ecov_where, Ecov_how, Ecov_lm,
1012
- n_NAA_sigma, do_proj, proj_F_opt, FAA, FAA_tot, MAA, mature, waa, waa_pointer_fleets, waa_pointer_ssb, fracyr_SSB, log_SPR0,
1013
- avg_years_ind, n_years_model, n_fleets, which_F_age, percentSPR, proj_Fcatch, percentFXSPR, F_proj_init, percentFMSY, proj_R_opt, XSPR_R_opt,
1011
+ matrix<Type> sims = sim_pop (NAA_devs, recruit_model, mean_rec_pars, SSB, NAA, log_SR_a, log_SR_b, Ecov_where, Ecov_how, Ecov_lm,
1012
+ n_NAA_sigma, do_proj, proj_F_opt, FAA, FAA_tot, MAA, mature, waa, waa_pointer_fleets, waa_pointer_ssb, fracyr_SSB, log_SPR0,
1013
+ avg_years_ind, n_years_model, n_fleets, which_F_age, percentSPR, proj_Fcatch, percentFXSPR, F_proj_init, percentFMSY, proj_R_opt, XSPR_R_opt,
1014
1014
XSPR_R_avg_yrs, bias_correct_pe, bias_correct_brps, sigma_a_sig);
1015
1015
SSB = sims.col (sims.cols ()-1 );
1016
- for (int a = 0 ; a < n_ages; a++)
1016
+ for (int a = 0 ; a < n_ages; a++)
1017
1017
{
1018
1018
NAA.col (a) = sims.col (a);
1019
1019
pred_NAA.col (a) = sims.col (a+n_ages);
@@ -1044,7 +1044,7 @@ Type objective_function<Type>::operator() ()
1044
1044
array<Type> catch_paa_proj (n_fleets, n_years_proj, n_ages);
1045
1045
nll_agg_catch.setZero ();
1046
1046
nll_catch_acomp.setZero ();
1047
-
1047
+
1048
1048
for (int y = 0 ; y < n_years_model+n_years_proj; y++)
1049
1049
{
1050
1050
// for now just use uncertainty from last year of catch
@@ -1091,7 +1091,7 @@ Type objective_function<Type>::operator() ()
1091
1091
// keep_Cpaa(i,y,0) is first val, keep_Cpaa(i,y,1) is the length of the vector
1092
1092
vector<Type> tf_paa_obs = obsvec.segment (keep_Cpaa (f,y,0 ), keep_Cpaa (f,y,1 ));
1093
1093
vector<int > ages_obs_y = agesvec.segment (keep_Cpaa (f,y,0 ), keep_Cpaa (f,y,1 ));
1094
- nll_catch_acomp (y,f) -= get_acomp_ll (tf_paa_obs, t_pred_paa, catch_Neff (y,f), ages_obs_y, age_comp_model_fleets (f),
1094
+ nll_catch_acomp (y,f) -= get_acomp_ll (tf_paa_obs, t_pred_paa, catch_Neff (y,f), ages_obs_y, age_comp_model_fleets (f),
1095
1095
vector<Type>(catch_paa_pars.row (f)), keep.segment (keep_Cpaa (f,y,0 ),keep_Cpaa (f,y,1 )), do_osa, paa_obs_y);
1096
1096
}
1097
1097
SIMULATE if (simulate_data (0 ) == 1 ) if (use_catch_paa (usey,f) == 1 ){
@@ -1170,7 +1170,7 @@ Type objective_function<Type>::operator() ()
1170
1170
}
1171
1171
if ((simulate_period (1 ) == 1 ) & (y > n_years_model - 1 )) agg_indices_proj (y-n_years_model,i) = exp (rnorm (pred_log_indices (y,i), sig));
1172
1172
}
1173
-
1173
+
1174
1174
if (any_index_age_comp (i) == 1 )
1175
1175
{
1176
1176
vector<Type> paa_obs_y (n_ages);
@@ -1186,7 +1186,7 @@ Type objective_function<Type>::operator() ()
1186
1186
// keep_Ipaa(i,y,0) is first val, keep_Ipaa(i,y,1) is the length of the vector
1187
1187
vector<Type> tf_paa_obs = obsvec.segment (keep_Ipaa (i,y,0 ), keep_Ipaa (i,y,1 ));
1188
1188
vector<int > ages_obs_y = agesvec.segment (keep_Ipaa (i,y,0 ), keep_Ipaa (i,y,1 ));
1189
- nll_index_acomp (y,i) -= get_acomp_ll (tf_paa_obs, t_pred_paa, index_Neff (y,i), ages_obs_y, age_comp_model_indices (i),
1189
+ nll_index_acomp (y,i) -= get_acomp_ll (tf_paa_obs, t_pred_paa, index_Neff (y,i), ages_obs_y, age_comp_model_indices (i),
1190
1190
vector<Type>(index_paa_pars.row (i)), keep.segment (keep_Ipaa (i,y,0 ),keep_Ipaa (i,y,1 )), do_osa, paa_obs_y);
1191
1191
}
1192
1192
SIMULATE if (simulate_data (1 ) == 1 ) if (use_index_paa (usey,i) == 1 ){
@@ -1222,7 +1222,7 @@ Type objective_function<Type>::operator() ()
1222
1222
REPORT (nll_index_acomp);
1223
1223
nll += nll_index_acomp.sum ();
1224
1224
// see(nll);
1225
-
1225
+
1226
1226
SIMULATE if (sum (simulate_data) > 0 ) REPORT (obsvec);
1227
1227
// -------------------------------------------------------------------
1228
1228
// Calculate catch in projection years
@@ -1292,7 +1292,7 @@ Type objective_function<Type>::operator() ()
1292
1292
}
1293
1293
1294
1294
// static/avg year results
1295
- vector<Type> SPR_res_static = get_static_SPR_res (MAA, FAA, which_F_age_static, waa, waa_pointer_ssb, waa_pointer_fleets, mature, percentSPR, R_XSPR,
1295
+ vector<Type> SPR_res_static = get_static_SPR_res (MAA, FAA, which_F_age_static, waa, waa_pointer_ssb, waa_pointer_fleets, mature, percentSPR, R_XSPR,
1296
1296
fracyr_SSB, static_FXSPR_init, avg_years_ind, avg_years_ind, avg_years_ind, avg_years_ind, avg_years_ind, XSPR_R_avg_yrs, sigma_a_sig_brps);
1297
1297
Type log_FXSPR_static = SPR_res_static (0 );
1298
1298
Type log_SSB_FXSPR_static = SPR_res_static (1 );
0 commit comments