diff --git a/docs/def_8hpp_source.html b/docs/def_8hpp_source.html
index 5f0e5b6..3af0851 100644
--- a/docs/def_8hpp_source.html
+++ b/docs/def_8hpp_source.html
@@ -91,68 +91,74 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 36 #define TMB_FIMS_REAL_TYPE double
- 37 #define TMB_FIMS_FIRST_ORDER AD<TMB_FIMS_REAL_TYPE>
- 38 #define TMB_FIMS_SECOND_ORDER AD<TMB_FIMS_FIRST_ORDER>
- 39 #define TMB_FIMS_THIRD_ORDER AD<TMB_FIMS_SECOND_ORDER>
-
-
-
-
-
-
- 50 static std::map<std::string, std::ofstream>
-
- 55 static std::ofstream&
get(
const std::string& l) {
- 56 typename std::map<std::string, std::ofstream>::iterator it;
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 29 "logs/population.log");
+
+ 31 "logs/recruitment.log");
+
+
+
+
+ 36 "logs/selectivity.log");
+
+ 38 "logs/debug/debug.log");
+
+
+ 42 #define TMB_FIMS_REAL_TYPE double
+ 43 #define TMB_FIMS_FIRST_ORDER AD<TMB_FIMS_REAL_TYPE>
+ 44 #define TMB_FIMS_SECOND_ORDER AD<TMB_FIMS_FIRST_ORDER>
+ 45 #define TMB_FIMS_THIRD_ORDER AD<TMB_FIMS_SECOND_ORDER>
+
+
+
+
+
+
+ 56 static std::map<std::string, std::ofstream>
+
+ 61 static std::ofstream&
get(
const std::string& l) {
+ 62 typename std::map<std::string, std::ofstream>::iterator it;
+
+
+
+
+
-
-
- 75 template <
typename Type>
-
- 77 typedef double real_t;
- 78 typedef double variable_t;
- 79 typedef typename std::vector<double> DataVector;
- 80 typedef typename std::vector<double> ParameterVector;
- 82 typedef typename std::vector<std::vector<double> > DataMatrix;
- 84 typedef typename std::vector<std::vector<double> > VariableMatrix;
-
-
-
-
-
-
-
-static std::map< std::string, std::ofstream > FIMS_LOGS
Definition: def.hpp:51
-static std::ofstream & get(const std::string &l)
Definition: def.hpp:55
+
+
+
+
+
+
+
+
+ 81 template <
typename Type>
+
+ 83 typedef double real_t;
+ 84 typedef double variable_t;
+ 85 typedef typename std::vector<double> DataVector;
+ 86 typedef typename std::vector<double> ParameterVector;
+ 88 typedef typename std::vector<std::vector<double> > DataMatrix;
+ 90 typedef typename std::vector<std::vector<double> > VariableMatrix;
+
+
+
+
+
+
+
+static std::map< std::string, std::ofstream > FIMS_LOGS
Definition: def.hpp:57
+static std::ofstream & get(const std::string &l)
Definition: def.hpp:61
std::ofstream MODEL_LOG("logs/model.log")
std::ofstream GROWTH_LOG("logs/growth.log")
std::ofstream ERROR_LOG("logs/error.log")
diff --git a/docs/double__logistic_8hpp_source.html b/docs/double__logistic_8hpp_source.html
index 4054ab1..c2bd6f2 100644
--- a/docs/double__logistic_8hpp_source.html
+++ b/docs/double__logistic_8hpp_source.html
@@ -93,16 +93,16 @@
20 template <
typename Type>
-
-
+
+
-
+
-
-
+ 50 return fims_math::double_logistic<Type>(
+
diff --git a/docs/fims__math_8hpp_source.html b/docs/fims__math_8hpp_source.html
index 31bc228..43a8817 100644
--- a/docs/fims__math_8hpp_source.html
+++ b/docs/fims__math_8hpp_source.html
@@ -138,52 +138,55 @@
102 template <
class Type>
- 103 inline const Type
logistic(
const Type &inflection_point,
const Type &slope,
const Type &x) {
- 104 return (1.0) / (1.0 + exp(-1.0 * slope * (x - inflection_point)));
-
-
- 117 template <
class Type>
- 118 inline const Type
logit(
const Type &a,
const Type &b,
const Type &x) {
- 119 return -fims_math::log(b - x) + fims_math::log(x - a);
-
-
- 132 template <
class Type>
- 133 inline const Type
inv_logit(
const Type &a,
const Type &b,
const Type &logit_x) {
- 134 return a + (b - a) / (1.0 + fims_math::exp(-logit_x));
-
-
- 156 template <
class Type>
- 157 inline const Type
double_logistic(
const Type &inflection_point_asc,
const Type &slope_asc,
- 158 const Type &inflection_point_desc,
const Type &slope_desc,
-
- 160 return (1.0) / (1.0 + exp(-1.0 * slope_asc * (x - inflection_point_asc))) *
- 161 (1.0 - (1.0) / (1.0 + exp(-1.0 * slope_desc * (x - inflection_point_desc))));
-
-
- 177 template <
class Type>
- 178 const Type
ad_fabs(
const Type &x, Type C = 1e-5) {
- 179 return sqrt((x * x) + C);
-
-
- 197 template <
typename Type>
- 198 inline const Type
ad_min(
const Type &a,
const Type &b, Type C = 1e-5) {
-
-
-
- 214 template <
typename Type>
- 215 inline const Type
ad_max(
const Type &a,
const Type &b, Type C = 1e-5) {
-
-
-
-
-
-
-const Type logit(const Type &a, const Type &b, const Type &x)
A logit function for bounding of parameters.
Definition: fims_math.hpp:118
-const Type ad_min(const Type &a, const Type &b, Type C=1e-5)
Definition: fims_math.hpp:198
-const Type double_logistic(const Type &inflection_point_asc, const Type &slope_asc, const Type &inflection_point_desc, const Type &slope_desc, const Type &x)
The general double logistic function.
Definition: fims_math.hpp:157
-const Type ad_max(const Type &a, const Type &b, Type C=1e-5)
Definition: fims_math.hpp:215
-const Type inv_logit(const Type &a, const Type &b, const Type &logit_x)
An inverse logit function for bounding of parameters.
Definition: fims_math.hpp:133
-const Type ad_fabs(const Type &x, Type C=1e-5)
Definition: fims_math.hpp:178
+ 103 inline const Type
logistic(
const Type &inflection_point,
const Type &slope,
+
+ 105 return (1.0) / (1.0 + exp(-1.0 * slope * (x - inflection_point)));
+
+
+ 118 template <
class Type>
+ 119 inline const Type
logit(
const Type &a,
const Type &b,
const Type &x) {
+ 120 return -fims_math::log(b - x) + fims_math::log(x - a);
+
+
+ 133 template <
class Type>
+ 134 inline const Type
inv_logit(
const Type &a,
const Type &b,
const Type &logit_x) {
+ 135 return a + (b - a) / (1.0 + fims_math::exp(-logit_x));
+
+
+ 158 template <
class Type>
+
+ 160 const Type &slope_asc,
+ 161 const Type &inflection_point_desc,
+ 162 const Type &slope_desc,
const Type &x) {
+ 163 return (1.0) / (1.0 + exp(-1.0 * slope_asc * (x - inflection_point_asc))) *
+
+ 165 (1.0) / (1.0 + exp(-1.0 * slope_desc * (x - inflection_point_desc))));
+
+
+ 181 template <
class Type>
+ 182 const Type
ad_fabs(
const Type &x, Type C = 1e-5) {
+ 183 return sqrt((x * x) + C);
+
+
+ 201 template <
typename Type>
+ 202 inline const Type
ad_min(
const Type &a,
const Type &b, Type C = 1e-5) {
+
+
+
+ 218 template <
typename Type>
+ 219 inline const Type
ad_max(
const Type &a,
const Type &b, Type C = 1e-5) {
+
+
+
+
+
+
+const Type logit(const Type &a, const Type &b, const Type &x)
A logit function for bounding of parameters.
Definition: fims_math.hpp:119
+const Type ad_min(const Type &a, const Type &b, Type C=1e-5)
Definition: fims_math.hpp:202
+const Type double_logistic(const Type &inflection_point_asc, const Type &slope_asc, const Type &inflection_point_desc, const Type &slope_desc, const Type &x)
The general double logistic function.
Definition: fims_math.hpp:159
+const Type ad_max(const Type &a, const Type &b, Type C=1e-5)
Definition: fims_math.hpp:219
+const Type inv_logit(const Type &a, const Type &b, const Type &logit_x)
An inverse logit function for bounding of parameters.
Definition: fims_math.hpp:134
+const Type ad_fabs(const Type &x, Type C=1e-5)
Definition: fims_math.hpp:182
const Type logistic(const Type &inflection_point, const Type &slope, const Type &x)
The general logistic function.
Definition: fims_math.hpp:103
diff --git a/docs/fleet_8hpp_source.html b/docs/fleet_8hpp_source.html
index 75f976c..00c0235 100644
--- a/docs/fleet_8hpp_source.html
+++ b/docs/fleet_8hpp_source.html
@@ -176,96 +176,92 @@
141 this->q = fims_math::exp(this->log_q);
142 for (
size_t year = 0; year < this->
nyears; year++) {
-
- 144 FLEET_LOG <<
"input F mort " << this->log_Fmort[year] << std::endl;
- 145 FLEET_LOG <<
"input q " << this->log_q << std::endl;
- 146 this->Fmort[year] = fims_math::exp(this->log_Fmort[year]);
-
-
-
-
-
-
-
- 154 fims_distributions::Dmultinom<Type> dmultinom;
-
-
- 157 if (dims != this->catch_numbers_at_age.size()) {
-
- 159 ERROR_LOG <<
"Error: observed age comp is of size "
- 160 << dims <<
" and expected is of size "
- 161 << this->age_composition.size() << std::endl;
-
-
-
- 165 for (
size_t y = 0; y < this->
nyears; y++) {
-
-
- 168 using Vector =
typename fims::ModelTraits<Type>::EigenVector;
- 169 Vector observed_acomp;
- 170 Vector expected_acomp;
-
- 172 observed_acomp.resize(this->nages);
- 173 expected_acomp.resize(this->nages);
-
- 175 for (
size_t a = 0; a < this->
nages; a++) {
- 176 size_t i_age_year = y * this->nages + a;
- 177 sum += this->catch_numbers_at_age[i_age_year];
-
-
- 180 for (
size_t a = 0; a < this->
nages; a++) {
- 181 size_t i_age_year = y * this->nages + a;
- 182 expected_acomp[a] = this->catch_numbers_at_age[i_age_year] /
-
-
-
-
- 187 FLEET_LOG <<
" age " << a <<
" in year " << y
- 188 <<
"has expected: " << expected_acomp[a]
- 189 <<
" and observed: " << observed_acomp[a] << std::endl;
-
- 191 dmultinom.x = observed_acomp;
- 192 dmultinom.p = expected_acomp;
- 193 nll -= dmultinom.evaluate(
true);
-
-
- 196 FLEET_LOG <<
"Age comp negative log-likelihood for fleet," << this->
id << nll << std::endl;
-
-
-
-
-
-
-
- 205 fims_distributions::Dnorm<Type> dnorm;
- 206 dnorm.sd = fims_math::exp(this->log_obs_error);
- 207 for (
size_t i = 0; i < this->expected_index.size(); i++) {
-
- 209 dnorm.mean = fims_math::log(this->expected_index[i]);
- 210 nll -= dnorm.evaluate(
true);
-
-
- 213 <<
"observed index data: " << i <<
" is "
-
- 215 <<
" and expected is: " << this->expected_index[i] << std::endl;
-
-
- 218 <<
" log obs error is: " << this->log_obs_error << std::endl;
- 219 FLEET_LOG <<
" sd is: " << dnorm.sd << std::endl;
- 220 FLEET_LOG <<
" index nll: " << nll << std::endl;
-
-
-
-
-
+ 143 FLEET_LOG <<
"input F mort " << this->log_Fmort[year] << std::endl;
+ 144 FLEET_LOG <<
"input q " << this->log_q << std::endl;
+ 145 this->Fmort[year] = fims_math::exp(this->log_Fmort[year]);
+
+
+
+
+
+
+ 152 fims_distributions::Dmultinom<Type> dmultinom;
+
+
+ 155 if (dims != this->catch_numbers_at_age.size()) {
+ 156 ERROR_LOG <<
"Error: observed age comp is of size " << dims
+ 157 <<
" and expected is of size " << this->age_composition.size()
+
+
+
+
+ 162 for (
size_t y = 0; y < this->
nyears; y++) {
+
+
+ 165 using Vector =
typename fims::ModelTraits<Type>::EigenVector;
+ 166 Vector observed_acomp;
+ 167 Vector expected_acomp;
+
+ 169 observed_acomp.resize(this->nages);
+ 170 expected_acomp.resize(this->nages);
+
+ 172 for (
size_t a = 0; a < this->
nages; a++) {
+ 173 size_t i_age_year = y * this->nages + a;
+ 174 sum += this->catch_numbers_at_age[i_age_year];
+
+
+ 177 for (
size_t a = 0; a < this->
nages; a++) {
+ 178 size_t i_age_year = y * this->nages + a;
+ 179 expected_acomp[a] = this->catch_numbers_at_age[i_age_year] /
+
+
+
+
+ 184 FLEET_LOG <<
" age " << a <<
" in year " << y
+ 185 <<
"has expected: " << expected_acomp[a]
+ 186 <<
" and observed: " << observed_acomp[a] << std::endl;
+
+ 188 dmultinom.x = observed_acomp;
+ 189 dmultinom.p = expected_acomp;
+ 190 nll -= dmultinom.evaluate(
true);
+
+
+ 193 FLEET_LOG <<
"Age comp negative log-likelihood for fleet," << this->
id
+
+
+
+
+
+
+
+
+ 203 fims_distributions::Dnorm<Type> dnorm;
+ 204 dnorm.sd = fims_math::exp(this->log_obs_error);
+ 205 for (
size_t i = 0; i < this->expected_index.size(); i++) {
+
+ 207 dnorm.mean = fims_math::log(this->expected_index[i]);
+ 208 nll -= dnorm.evaluate(
true);
+
+ 210 FLEET_LOG <<
"observed index data: " << i <<
" is "
+
+ 212 <<
" and expected is: " << this->expected_index[i] << std::endl;
+
+ 214 FLEET_LOG <<
" log obs error is: " << this->log_obs_error << std::endl;
+ 215 FLEET_LOG <<
" sd is: " << dnorm.sd << std::endl;
+ 216 FLEET_LOG <<
" index nll: " << nll << std::endl;
+
+
+
+
+
+
+
+ 224 template <
class Type>
+
-
- 228 template <
class Type>
-
-
-
-
-
+
+
+
std::ofstream ERROR_LOG("logs/error.log")
std::ofstream FLEET_LOG("logs/fleet.log")
FIMSObject struct that defines member types and returns the unique id.
Definition: model_object.hpp:25
@@ -279,7 +275,7 @@
static uint32_t id_g
Definition: fleet.hpp:26
size_t nages
Definition: fleet.hpp:28
std::vector< Type > catch_numbers_at_age
Definition: fleet.hpp:79
-virtual const Type evaluate_index_nll()
Definition: fleet.hpp:201
+virtual const Type evaluate_index_nll()
Definition: fleet.hpp:199
int fleet_selectivity_id_m
Definition: fleet.hpp:50
Type q
Definition: fleet.hpp:69
std::vector< Type > catch_at_age
Definition: fleet.hpp:72
@@ -289,7 +285,7 @@
int fleet_observed_agecomp_data_id_m
Definition: fleet.hpp:58
std::shared_ptr< fims_data_object::DataObject< Type > > observed_index_data
Definition: fleet.hpp:56
std::shared_ptr< fims_distributions::DistributionsBase< Type > > index_likelihood
Definition: fleet.hpp:40
-virtual const Type evaluate_age_comp_nll()
Definition: fleet.hpp:151
+virtual const Type evaluate_age_comp_nll()
Definition: fleet.hpp:149
std::vector< Type > expected_index
Definition: fleet.hpp:78
int fleet_index_likelihood_id_m
Definition: fleet.hpp:35
void Prepare()
Prepare to run the fleet module. Called at each model itartion, and used to exponentiate the log q an...
Definition: fleet.hpp:123
diff --git a/docs/information_8hpp_source.html b/docs/information_8hpp_source.html
index 99fe5ef..dcb18a1 100644
--- a/docs/information_8hpp_source.html
+++ b/docs/information_8hpp_source.html
@@ -176,327 +176,360 @@
-
- 161 bool valid_model =
true;
-
- 163 INFO_LOG <<
"Beginning to create FIMS model in information.hpp CreateModel(). " << std::endl;
- 164 INFO_LOG <<
"Initializing fleet objects for " << this->
fleets.size() <<
" fleets." << std::endl;
-
-
-
-
- 169 std::shared_ptr<fims_popdy::Fleet<Type> > f = (*it).second;
- 170 INFO_LOG <<
"Initializing fleet " << f->id <<
"." << std::endl;
-
- 172 f->Initialize(f->nyears, f->nages);
-
-
- 175 <<
" data objects." << std::endl;
-
- 177 INFO_LOG <<
"Checking for available fleet index data objects." << std::endl;
-
- 179 if (f->fleet_observed_index_data_id_m != -999) {
- 180 uint32_t observed_index_id =
- 181 static_cast<uint32_t
>(f->fleet_observed_index_data_id_m);
-
- 183 INFO_LOG <<
"Input fleet index id = " << observed_index_id <<
"."
-
-
-
- 187 f->observed_index_data = (*it).second;
- 188 INFO_LOG <<
"Index data successfully set." << std::endl;
-
- 190 DATA_LOG <<
"Observed input for fleet " << f->id <<
", index " << observed_index_id <<
": \n " << f->observed_index_data->at(1)
-
-
-
- 194 ERROR_LOG <<
"Error: Expected data observations not defined for fleet"
- 195 << f->id <<
", index " << observed_index_id << std::endl;
-
-
-
-
-
- 201 ERROR_LOG <<
"Error: No index data observed for fleet " << f->id
- 202 <<
". FIMS requires index data for all fleets." << std::endl;
-
-
-
-
- 207 INFO_LOG <<
"Checking for available fleet age comp data objects." << std::endl;
-
- 209 if (f->fleet_observed_agecomp_data_id_m != -999) {
- 210 uint32_t observed_agecomp_id =
- 211 static_cast<uint32_t
>(f->fleet_observed_agecomp_data_id_m);
-
- 213 INFO_LOG <<
"Input fleet age comp id = " << observed_agecomp_id <<
"."
-
-
-
- 217 f->observed_agecomp_data = (*it).second;
- 218 INFO_LOG <<
"Age comp data successfully set." << std::endl;
-
- 220 DATA_LOG <<
"Observed input age comp for fleet " << f->id <<
", comp " << observed_agecomp_id <<
": \n " << f->observed_agecomp_data->at(1)
-
-
-
- 224 ERROR_LOG <<
"Error: Expected age comp data observations not defined for fleet "
- 225 << f->id <<
", index " << observed_agecomp_id << std::endl;
-
-
-
-
-
- 231 ERROR_LOG <<
"Error: No age comp data observed for fleet " << f->id
- 232 <<
". FIMS requires age comp data for all fleets." << std::endl;
-
-
-
-
- 237 INFO_LOG <<
"Checking for available fleet selectivity pattern." << std::endl;
-
- 239 if (f->fleet_selectivity_id_m != -999) {
- 240 uint32_t sel_id =
static_cast<uint32_t
>(
- 241 f->fleet_selectivity_id_m);
-
-
- 244 INFO_LOG <<
"Input fleet selectivity pattern id = " << sel_id
-
+
+ 162 bool valid_model =
true;
+
+
+ 165 <<
"Beginning to create FIMS model in information.hpp CreateModel(). "
+
+ 167 INFO_LOG <<
"Initializing fleet objects for " << this->
fleets.size()
+ 168 <<
" fleets." << std::endl;
+
+
+
+
+ 173 std::shared_ptr<fims_popdy::Fleet<Type> > f = (*it).second;
+ 174 INFO_LOG <<
"Initializing fleet " << f->id <<
"." << std::endl;
+
+ 176 f->Initialize(f->nyears, f->nages);
+
+
+ 179 <<
" data objects." << std::endl;
+
+ 181 INFO_LOG <<
"Checking for available fleet index data objects."
+
+
+ 184 if (f->fleet_observed_index_data_id_m != -999) {
+ 185 uint32_t observed_index_id =
+ 186 static_cast<uint32_t
>(f->fleet_observed_index_data_id_m);
+
+ 188 INFO_LOG <<
"Input fleet index id = " << observed_index_id <<
"."
+
+
+
+ 192 f->observed_index_data = (*it).second;
+ 193 INFO_LOG <<
"Index data successfully set." << std::endl;
+
+ 195 DATA_LOG <<
"Observed input for fleet " << f->id <<
", index "
+ 196 << observed_index_id <<
": \n "
+ 197 << f->observed_index_data->at(1) << std::endl;
+
+
+ 200 ERROR_LOG <<
"Error: Expected data observations not defined for fleet"
+ 201 << f->id <<
", index " << observed_index_id << std::endl;
+
+
+
+
+
+ 207 ERROR_LOG <<
"Error: No index data observed for fleet " << f->id
+ 208 <<
". FIMS requires index data for all fleets." << std::endl;
+
+
+
+
+ 213 INFO_LOG <<
"Checking for available fleet age comp data objects."
+
+
+ 216 if (f->fleet_observed_agecomp_data_id_m != -999) {
+ 217 uint32_t observed_agecomp_id =
+ 218 static_cast<uint32_t
>(f->fleet_observed_agecomp_data_id_m);
+
+ 220 INFO_LOG <<
"Input fleet age comp id = " << observed_agecomp_id <<
"."
+
+
+
+ 224 f->observed_agecomp_data = (*it).second;
+ 225 INFO_LOG <<
"Age comp data successfully set." << std::endl;
+
+ 227 DATA_LOG <<
"Observed input age comp for fleet " << f->id <<
", comp "
+ 228 << observed_agecomp_id <<
": \n "
+ 229 << f->observed_agecomp_data->at(1) << std::endl;
+
+
+ 232 ERROR_LOG <<
"Error: Expected age comp data observations not defined "
+
+ 234 << f->id <<
", index " << observed_agecomp_id << std::endl;
+
+
+
+
+
+ 240 ERROR_LOG <<
"Error: No age comp data observed for fleet " << f->id
+ 241 <<
". FIMS requires age comp data for all fleets."
+
+
+
+
-
- 248 f->selectivity = (*it).second;
-
-
- 251 INFO_LOG <<
"Selectivity successfully set." << std::endl;
-
-
- 254 ERROR_LOG <<
"Error: Expected selectivity pattern not defined for fleet "
- 255 << f->id <<
", selectivity pattern " << sel_id << std::endl;
-
-
-
-
-
- 261 ERROR_LOG <<
"Error: No selectivity pattern defined for fleet " << f->id
- 262 <<
". FIMS requires selectivity be defined for all fleets." << std::endl;
-
-
-
-
- 267 INFO_LOG <<
"Checking for available index likelihood function." << std::endl;
-
- 269 if (f->fleet_index_likelihood_id_m != -999) {
- 270 uint32_t ind_like_id =
static_cast<uint32_t
>(
- 271 f->fleet_index_likelihood_id_m);
-
-
- 274 INFO_LOG <<
"Input index likelihood function id = " << ind_like_id
-
-
-
- 278 f->index_likelihood =
-
-
-
- 282 INFO_LOG <<
"Index likelihood function successfully set." << std::endl;
-
-
-
-
-
-
-
+ 247 INFO_LOG <<
"Checking for available fleet selectivity pattern."
+
+
+ 250 if (f->fleet_selectivity_id_m != -999) {
+ 251 uint32_t sel_id =
static_cast<uint32_t
>(
+ 252 f->fleet_selectivity_id_m);
+
+
+ 255 INFO_LOG <<
"Input fleet selectivity pattern id = " << sel_id <<
"."
+
+
+
+ 259 f->selectivity = (*it).second;
+
+
+ 262 INFO_LOG <<
"Selectivity successfully set." << std::endl;
+
+
+
+ 266 <<
"Error: Expected selectivity pattern not defined for fleet "
+ 267 << f->id <<
", selectivity pattern " << sel_id << std::endl;
+
+
+
+
+
+ 273 ERROR_LOG <<
"Error: No selectivity pattern defined for fleet " << f->id
+ 274 <<
". FIMS requires selectivity be defined for all fleets."
+
+
+
+
+
+ 280 INFO_LOG <<
"Checking for available index likelihood function."
+
+
+ 283 if (f->fleet_index_likelihood_id_m != -999) {
+ 284 uint32_t ind_like_id =
static_cast<uint32_t
>(
+ 285 f->fleet_index_likelihood_id_m);
+
+
+ 288 INFO_LOG <<
"Input index likelihood function id = " << ind_like_id
+
-
-
-
-
-
-
-
-
-
- 300 INFO_LOG <<
"Checking for available age comp likelihood function." << std::endl;
-
- 302 if (f->fleet_agecomp_likelihood_id_m != -999) {
- 303 uint32_t ac_like_id =
static_cast<uint32_t
>(
- 304 f->fleet_agecomp_likelihood_id_m);
-
-
- 307 INFO_LOG <<
"Input age comp likelihood function id = " << ac_like_id
-
-
-
- 311 f->agecomp_likelihood =
-
-
-
- 315 INFO_LOG <<
"Age comp likelihood function successfully set." << std::endl;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 333 INFO_LOG <<
"Completed initialization for fleet " << f->id <<
"." << std::endl;
-
-
- 336 INFO_LOG <<
"Completed initialization of all fleets." << std::endl;
-
- 338 INFO_LOG <<
"Initializing population objects for " << this->
populations.size() <<
" populations." << std::endl;
-
-
-
- 342 std::shared_ptr<fims_popdy::Population<Type> > p = (*it).second;
+
+ 292 f->index_likelihood =
+
+
+
+ 296 INFO_LOG <<
"Index likelihood function successfully set."
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 317 INFO_LOG <<
"Checking for available age comp likelihood function."
+
+
+ 320 if (f->fleet_agecomp_likelihood_id_m != -999) {
+ 321 uint32_t ac_like_id =
static_cast<uint32_t
>(
+ 322 f->fleet_agecomp_likelihood_id_m);
+
+
+ 325 INFO_LOG <<
"Input age comp likelihood function id = " << ac_like_id
+
+
+
+ 329 f->agecomp_likelihood =
+
+
+
+ 333 INFO_LOG <<
"Age comp likelihood function successfully set."
+
+
+
+
+
+
+
+
+
- 344 INFO_LOG <<
"Setting up links from population " << p->id
- 345 <<
" to fleets [ " << std::flush;
-
-
-
-
-
- 351 std::shared_ptr<fims_popdy::Fleet<Type> > f = (*it).second;
-
-
-
- 355 p->fleets.push_back(f);
- 356 INFO_LOG << f->id <<
" " << std::flush;
-
-
+
+
+
+
+
+
+
+
+
+
+ 354 INFO_LOG <<
"Completed initialization for fleet " << f->id <<
"."
+
+
+
+ 358 INFO_LOG <<
"Completed initialization of all fleets." << std::endl;
- 360 INFO_LOG <<
"Initializing population " << p->id <<
"." << std::endl;
- 361 p->Initialize(p->nyears, p->nseasons, p->nages);
-
- 363 INFO_LOG <<
"Checking for available recruitment function." << std::endl;
-
- 365 if (p->recruitment_id != -999) {
- 366 uint32_t recruitment_uint =
static_cast<uint32_t
>(p->recruitment_id);
-
-
- 369 INFO_LOG <<
"Input recruitment id = " << recruitment_uint <<
"." << std::endl;
-
-
-
- 373 INFO_LOG <<
"Recruitment function successfully set." << std::endl;
-
-
- 376 ERROR_LOG <<
"Error: Expected recruitment function not defined for population "
- 377 << p->id <<
", recruitment function " << recruitment_uint << std::endl;
-
-
-
-
-
- 383 ERROR_LOG <<
"Error: No recruitment function defined for population " << p->id
- 384 <<
". FIMS requires recruitment functions be defined for all populations."
-
-
-
-
- 389 INFO_LOG <<
"Checking for available growth function." << std::endl;
-
- 391 if (p->growth_id != -999) {
- 392 uint32_t growth_uint =
static_cast<uint32_t
>(p->growth_id);
-
-
-
-
-
- 398 INFO_LOG <<
"Input growth id = " << growth_uint <<
"." << std::endl;
-
-
-
-
- 403 INFO_LOG <<
"Growth function successfully set." << std::endl;
-
-
- 406 ERROR_LOG <<
"Error: Expected growth function not defined for population "
- 407 << p->id <<
", growth function " << growth_uint << std::endl;
-
-
-
-
-
- 413 ERROR_LOG <<
"Error: No growth function defined for population " << p->id
- 414 <<
". FIMS requires growth functions be defined for all populations."
-
-
-
-
- 419 INFO_LOG <<
"Checking for available maturity function." << std::endl;
-
- 421 if (p->maturity_id != -999) {
- 422 uint32_t maturity_uint =
static_cast<uint32_t
>(p->maturity_id);
-
-
-
- 426 INFO_LOG <<
"Input maturity id = " << maturity_uint <<
"." << std::endl;
-
- 428 p->maturity = (*it).second;
- 429 INFO_LOG <<
"Maturity function successfully set." << std::endl;
-
-
- 432 ERROR_LOG <<
"Error: Expected maturity function not defined for population "
- 433 << p->id <<
", maturity function " << maturity_uint << std::endl;
-
-
-
-
-
- 439 ERROR_LOG <<
"Error: No maturity function defined for population " << p->id
- 440 <<
". FIMS requires maturity functions be defined for all populations."
-
-
-
- 444 INFO_LOG <<
"Completed initialization for population " << p->id <<
"." << std::endl;
-
- 446 INFO_LOG <<
"Completed initialization of all populations." << std::endl;
- 447 INFO_LOG <<
"Completed FIMS model creation." << std::endl;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 519 template <
typename Type>
-
-
-
-
-
-
+ 360 INFO_LOG <<
"Initializing population objects for "
+ 361 << this->
populations.size() <<
" populations." << std::endl;
+
+
+ 364 std::shared_ptr<fims_popdy::Population<Type> > p = (*it).second;
+
+ 366 INFO_LOG <<
"Setting up links from population " << p->id
+ 367 <<
" to fleets [ " << std::flush;
+
+
+
+
+
+ 373 std::shared_ptr<fims_popdy::Fleet<Type> > f = (*it).second;
+
+
+
+ 377 p->fleets.push_back(f);
+ 378 INFO_LOG << f->id <<
" " << std::flush;
+
+
+
+ 382 INFO_LOG <<
"Initializing population " << p->id <<
"." << std::endl;
+ 383 p->Initialize(p->nyears, p->nseasons, p->nages);
+
+ 385 INFO_LOG <<
"Checking for available recruitment function." << std::endl;
+
+ 387 if (p->recruitment_id != -999) {
+ 388 uint32_t recruitment_uint =
static_cast<uint32_t
>(p->recruitment_id);
+
+
+ 391 INFO_LOG <<
"Input recruitment id = " << recruitment_uint <<
"."
+
+
+
+
+ 396 INFO_LOG <<
"Recruitment function successfully set." << std::endl;
+
+
+ 399 ERROR_LOG <<
"Error: Expected recruitment function not defined for "
+
+ 401 << p->id <<
", recruitment function " << recruitment_uint
+
+
+
+
+
+
+ 408 ERROR_LOG <<
"Error: No recruitment function defined for population "
+
+ 410 <<
". FIMS requires recruitment functions be defined for all "
+
+
+
+
+
+ 416 INFO_LOG <<
"Checking for available growth function." << std::endl;
+
+ 418 if (p->growth_id != -999) {
+ 419 uint32_t growth_uint =
static_cast<uint32_t
>(p->growth_id);
+
+
+
+
+
+ 425 INFO_LOG <<
"Input growth id = " << growth_uint <<
"." << std::endl;
+
+
+
+
+ 430 INFO_LOG <<
"Growth function successfully set." << std::endl;
+
+
+
+ 434 <<
"Error: Expected growth function not defined for population "
+ 435 << p->id <<
", growth function " << growth_uint << std::endl;
+
+
+
+
+
+ 441 ERROR_LOG <<
"Error: No growth function defined for population "
+
+ 443 <<
". FIMS requires growth functions be defined for all "
+
+
+
+
+
+ 449 INFO_LOG <<
"Checking for available maturity function." << std::endl;
+
+ 451 if (p->maturity_id != -999) {
+ 452 uint32_t maturity_uint =
static_cast<uint32_t
>(p->maturity_id);
+
+
+
+ 456 INFO_LOG <<
"Input maturity id = " << maturity_uint <<
"." << std::endl;
+
+ 458 p->maturity = (*it).second;
+ 459 INFO_LOG <<
"Maturity function successfully set." << std::endl;
+
+
+
+ 463 <<
"Error: Expected maturity function not defined for population "
+ 464 << p->id <<
", maturity function " << maturity_uint << std::endl;
+
+
+
+
+
+ 470 ERROR_LOG <<
"Error: No maturity function defined for population "
+
+ 472 <<
". FIMS requires maturity functions be defined for all "
+
+
+
+
+ 477 INFO_LOG <<
"Completed initialization for population " << p->id <<
"."
+
+
+ 480 INFO_LOG <<
"Completed initialization of all populations." << std::endl;
+ 481 INFO_LOG <<
"Completed FIMS model creation." << std::endl;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 553 template <
typename Type>
+
+
+
+
+
+
@@ -508,31 +541,31 @@
-
-
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
std::ofstream ERROR_LOG("logs/error.log")
diff --git a/docs/maturity_2functors_2logistic_8hpp_source.html b/docs/maturity_2functors_2logistic_8hpp_source.html
index 83db093..73655bb 100644
--- a/docs/maturity_2functors_2logistic_8hpp_source.html
+++ b/docs/maturity_2functors_2logistic_8hpp_source.html
@@ -96,10 +96,10 @@
22 template <
typename Type>
-
+
-
+
diff --git a/docs/model_8hpp_source.html b/docs/model_8hpp_source.html
index f71b833..11c00a2 100644
--- a/docs/model_8hpp_source.html
+++ b/docs/model_8hpp_source.html
@@ -156,131 +156,138 @@
-
-
- 96 MODEL_LOG <<
"Evaluating expected values and summing recruitment nlls for " << this->
fims_information->populations.size() <<
" populations." << std::endl;
-
-
-
-
- 101 MODEL_LOG <<
"Setting up pointer to population " << (*it).second->id <<
"." << std::endl;
-
- 103 (*it).second->recruitment->Prepare();
- 104 MODEL_LOG <<
"Recruitment for population successfully prepared" << std::endl;
-
-
- 107 (*it).second->of = this->of;
-
-
- 110 (*it).second->Evaluate();
-
- 112 rec_nll += (*it).second->recruitment->evaluate_nll();
- 113 MODEL_LOG <<
"Recruitment negative log-likelihood is: " << rec_nll << std::endl;
-
- 115 MODEL_LOG <<
"All populations successfully evaluated." << std::endl;
-
-
-
-
- 120 MODEL_LOG <<
"Evaluating expected values and summing nlls for " << this->
fims_information->fleets.size() <<
" fleets." << std::endl;
-
-
-
-
-
- 126 (*jt).second->of = this->of;
-
- 128 MODEL_LOG <<
"Setting up pointer to fleet " << (*jt).second->id <<
"." << std::endl;
- 129 age_comp_nll += (*jt).second->evaluate_age_comp_nll();
- 130 MODEL_LOG <<
"Sum of survey and age comp negative log-likelihood is: " << age_comp_nll
-
- 132 index_nll += (*jt).second->evaluate_index_nll();
-
- 134 MODEL_LOG <<
"All fleets successfully evaluated." << std::endl;
-
-
-
-
-
-
-
- 142 naa(pop_idx) = vector<Type>((*it).second->numbers_at_age);
- 143 ssb(pop_idx) = vector<Type>((*it).second->spawning_biomass);
-
- 145 vector<Type>((*it).second->recruitment->recruit_deviations);
- 146 recruitment(pop_idx) = vector<Type>((*it).second->expected_recruitment);
- 147 biomass(pop_idx) = vector<Type>((*it).second->biomass);
- 148 M(pop_idx) = vector<Type>((*it).second->M);
-
-
-
-
-
-
-
-
-
- 158 exp_index(fleet_idx) = vector<Type>((*jt).second->expected_index);
- 159 exp_catch(fleet_idx) = vector<Type>((*jt).second->expected_catch);
- 160 F_mort(fleet_idx) = vector<Type>((*jt).second->Fmort);
- 161 cnaa(fleet_idx) = vector<Type>((*jt).second->catch_numbers_at_age);
- 162 cwaa(fleet_idx) = vector<Type>((*jt).second->catch_weight_at_age);
-
-
-
-
- 167 jnll = rec_nll + age_comp_nll + index_nll;
-
-
-
- 171 REPORT_F(rec_nll, of);
- 172 REPORT_F(age_comp_nll, of);
- 173 REPORT_F(index_nll, of);
-
-
-
- 177 REPORT_F(rec_dev, of);
- 178 REPORT_F(recruitment, of);
- 179 REPORT_F(biomass, of);
-
- 181 REPORT_F(exp_index, of);
- 182 REPORT_F(exp_catch, of);
- 183 REPORT_F(F_mort, of);
-
-
-
-
-
-
-
- 191 vector<Type> NAA = ADREPORTvector(naa);
- 192 vector<Type> Biomass = ADREPORTvector(biomass);
- 193 vector<Type> SSB = ADREPORTvector(ssb);
- 194 vector<Type> RecDev = ADREPORTvector(rec_dev);
- 195 vector<Type> FMort = ADREPORTvector(F_mort);
- 196 vector<Type> ExpectedIndex = ADREPORTvector(exp_index);
- 197 vector<Type> CNAA = ADREPORTvector(cnaa);
-
-
- 200 ADREPORT_F(Biomass, of);
-
- 202 ADREPORT_F(RecDev, of);
- 203 ADREPORT_F(FMort, of);
- 204 ADREPORT_F(ExpectedIndex, of);
- 205 ADREPORT_F(CNAA, of);
-
-
-
-
-
-
-
- 213 template <
typename Type>
-
-
-
-
-
+
+ 95 MODEL_LOG <<
"Evaluating expected values and summing recruitment nlls for "
+
+
+
+
+
+
+ 102 MODEL_LOG <<
"Setting up pointer to population " << (*it).second->id
+
+
+ 105 (*it).second->recruitment->Prepare();
+ 106 MODEL_LOG <<
"Recruitment for population successfully prepared"
+
+
+
+ 110 (*it).second->of = this->of;
+
+
+ 113 (*it).second->Evaluate();
+
+ 115 rec_nll += (*it).second->recruitment->evaluate_nll();
+ 116 MODEL_LOG <<
"Recruitment negative log-likelihood is: " << rec_nll
+
+
+ 119 MODEL_LOG <<
"All populations successfully evaluated." << std::endl;
+
+
+
+
+ 124 MODEL_LOG <<
"Evaluating expected values and summing nlls for "
+
+
+
+
+
+
+
+ 132 (*jt).second->of = this->of;
+
+ 134 MODEL_LOG <<
"Setting up pointer to fleet " << (*jt).second->id <<
"."
+
+ 136 age_comp_nll += (*jt).second->evaluate_age_comp_nll();
+ 137 MODEL_LOG <<
"Sum of survey and age comp negative log-likelihood is: "
+ 138 << age_comp_nll << std::endl;
+ 139 index_nll += (*jt).second->evaluate_index_nll();
+
+ 141 MODEL_LOG <<
"All fleets successfully evaluated." << std::endl;
+
+
+
+
+
+
+
+ 149 naa(pop_idx) = vector<Type>((*it).second->numbers_at_age);
+ 150 ssb(pop_idx) = vector<Type>((*it).second->spawning_biomass);
+
+ 152 vector<Type>((*it).second->recruitment->recruit_deviations);
+ 153 recruitment(pop_idx) = vector<Type>((*it).second->expected_recruitment);
+ 154 biomass(pop_idx) = vector<Type>((*it).second->biomass);
+ 155 M(pop_idx) = vector<Type>((*it).second->M);
+
+
+
+
+
+
+
+
+
+ 165 exp_index(fleet_idx) = vector<Type>((*jt).second->expected_index);
+ 166 exp_catch(fleet_idx) = vector<Type>((*jt).second->expected_catch);
+ 167 F_mort(fleet_idx) = vector<Type>((*jt).second->Fmort);
+ 168 cnaa(fleet_idx) = vector<Type>((*jt).second->catch_numbers_at_age);
+ 169 cwaa(fleet_idx) = vector<Type>((*jt).second->catch_weight_at_age);
+
+
+
+
+ 174 jnll = rec_nll + age_comp_nll + index_nll;
+
+
+
+ 178 REPORT_F(rec_nll, of);
+ 179 REPORT_F(age_comp_nll, of);
+ 180 REPORT_F(index_nll, of);
+
+
+
+ 184 REPORT_F(rec_dev, of);
+ 185 REPORT_F(recruitment, of);
+ 186 REPORT_F(biomass, of);
+
+ 188 REPORT_F(exp_index, of);
+ 189 REPORT_F(exp_catch, of);
+ 190 REPORT_F(F_mort, of);
+
+
+
+
+
+
+
+ 198 vector<Type> NAA = ADREPORTvector(naa);
+ 199 vector<Type> Biomass = ADREPORTvector(biomass);
+ 200 vector<Type> SSB = ADREPORTvector(ssb);
+ 201 vector<Type> RecDev = ADREPORTvector(rec_dev);
+ 202 vector<Type> FMort = ADREPORTvector(F_mort);
+ 203 vector<Type> ExpectedIndex = ADREPORTvector(exp_index);
+ 204 vector<Type> CNAA = ADREPORTvector(cnaa);
+
+
+ 207 ADREPORT_F(Biomass, of);
+
+ 209 ADREPORT_F(RecDev, of);
+ 210 ADREPORT_F(FMort, of);
+ 211 ADREPORT_F(ExpectedIndex, of);
+ 212 ADREPORT_F(CNAA, of);
+
+
+
+
+
+
+
+ 220 template <
typename Type>
+
+
+
+
+
diff --git a/docs/population_8hpp_source.html b/docs/population_8hpp_source.html
index e52e69d..81cc855 100644
--- a/docs/population_8hpp_source.html
+++ b/docs/population_8hpp_source.html
@@ -242,398 +242,402 @@
215 this->
fleets[fleet_]->Fmort[year] *
217 this->
fleets[fleet_]->selectivity->evaluate(
ages[age]);
- 218 POPULATION_LOG <<
" selectivity at age " <<
ages[age] <<
" for fleet " << fleet_ <<
" is "
- 219 << this->
fleets[fleet_]->selectivity->evaluate(
ages[age])
- 220 <<
" apical fishing mortality F for the fleet in year " << year <<
" is "
- 221 << this->
fleets[fleet_]->Fmort[year] << std::endl;
-
-
- 224 POPULATION_LOG <<
"M in calculate mortality is " << this->M[i_age_year]
-
-
- 227 this->M[i_age_year] + this->mortality_F[i_age_year];
-
-
-
-
-
- 240 this->numbers_at_age[i_age_year] =
- 241 this->numbers_at_age[i_agem1_yearm1] *
-
- 243 (fims_math::exp(-this->
mortality_Z[i_agem1_yearm1]));
- 244 POPULATION_LOG <<
" z at i_agem1_yearm1 = " << i_agem1_yearm1 <<
" is "
-
-
- 247 if (age == (this->nages - 1)) {
- 248 this->numbers_at_age[i_age_year] =
- 249 this->numbers_at_age[i_age_year] +
- 250 this->numbers_at_age[i_agem1_yearm1 + 1] *
- 251 (fims_math::exp(-this->
mortality_Z[i_agem1_yearm1 + 1]));
-
-
-
-
- 263 size_t i_agem1_yearm1,
size_t age) {
-
-
-
-
- 268 (fims_math::exp(-this->M[i_agem1_yearm1]));
- 269 POPULATION_LOG <<
"survival rate at index " << i_agem1_yearm1 <<
" is "
- 270 << fims_math::exp(-(this->M[i_agem1_yearm1])) << std::endl;
-
-
- 273 if (age == (this->nages - 1)) {
-
-
-
- 277 (fims_math::exp(-this->M[i_agem1_yearm1 + 1]));
-
-
-
-
-
-
-
-
- 293 <<
" biomass inputs----- +++\n";
-
-
-
-
-
-
-
-
- 317 this->spawning_biomass[year] += this->proportion_female *
- 318 this->numbers_at_age[i_age_year] *
- 319 this->proportion_mature_at_age[i_age_year] *
-
- 321 POPULATION_LOG <<
" proportion female " << this->proportion_female <<
" "
- 322 <<
" mature age " << age <<
" is "
- 323 << this->proportion_mature_at_age[i_age_year] <<
" "
- 324 <<
" numbers at age " << this->numbers_at_age[i_age_year] <<
" "
- 325 <<
" growth " << this->weight_at_age[age] <<
" "
- 326 <<
" spawning biomass " << this->spawning_biomass[year] <<
" "
- 327 <<
" spawning biomass inputs----- +++\n";
-
-
-
-
- 340 this->unfished_spawning_biomass[year] +=
-
- 342 this->proportion_mature_at_age[i_age_year] *
-
-
-
-
- 352 std::vector<Type> numbers_spr(this->nages, 1.0);
-
- 354 phi_0 += numbers_spr[0] * this->proportion_female *
- 355 this->proportion_mature_at_age[0] *
- 356 this->
growth->evaluate(ages[0]);
- 357 for (
size_t a = 1; a < (this->nages - 1); a++) {
- 358 numbers_spr[a] = numbers_spr[a - 1] * fims_math::exp(-this->M[a]);
- 359 phi_0 += numbers_spr[a] * this->proportion_female *
- 360 this->proportion_mature_at_age[a] *
- 361 this->
growth->evaluate(ages[a]);
-
-
- 364 numbers_spr[this->nages - 1] =
- 365 (numbers_spr[
nages - 2] * fims_math::exp(-this->M[
nages - 2])) /
- 366 (1 - fims_math::exp(-this->M[this->nages - 1]));
- 367 phi_0 += numbers_spr[this->nages - 1] * this->proportion_female *
- 368 this->proportion_mature_at_age[this->nages - 1] *
- 369 this->
growth->evaluate(ages[this->nages - 1]);
-
-
-
-
-
-
-
-
- 384 POPULATION_LOG <<
"spawning biomass = " << this->spawning_biomass[year]
-
-
-
-
- 389 << this->
recruitment->evaluate(this->spawning_biomass[year - 1],
-
-
- 392 this->numbers_at_age[i_age_year] =
- 393 this->
recruitment->evaluate(this->spawning_biomass[year - 1], phi0) *
-
- 395 this->expected_recruitment[year] = this->numbers_at_age[i_age_year];
- 396 POPULATION_LOG <<
" numbers at age at indexya " << i_age_year <<
" is "
- 397 << this->numbers_at_age[i_age_year] << std::endl;
-
-
-
- 407 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
- 408 if (this->
fleets[fleet_]->is_survey ==
false) {
- 409 size_t index_yf = year * this->nfleets +
-
- 411 size_t i_age_year = year * this->nages + age;
-
- 413 POPULATION_LOG <<
" fleet " << fleet_ <<
" year " << year <<
" age " << age
-
- 415 this->expected_catch[index_yf] +=
- 416 this->
fleets[fleet_]->catch_weight_at_age[i_age_year];
-
- 418 POPULATION_LOG <<
"expected catch: " << this->expected_catch[index_yf]
-
- 420 POPULATION_LOG <<
"----------------------------------------------"
-
-
- 423 fleets[fleet_]->expected_catch[year] +=
- 424 this->
fleets[fleet_]->catch_weight_at_age[i_age_year];
-
-
-
-
-
- 437 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
-
-
- 440 if (this->
fleets[fleet_]->is_survey ==
false) {
- 441 index_ = this->
fleets[fleet_]->catch_numbers_at_age[i_age_year] *
-
-
- 444 POPULATION_LOG <<
"fleet " << fleet_ <<
" is a survey" << std::endl;
- 445 index_ = this->
fleets[fleet_]->q *
- 446 this->
fleets[fleet_]->selectivity->evaluate(
ages[age]) *
- 447 this->numbers_at_age[i_age_year] *
-
-
- 450 fleets[fleet_]->expected_index[year] += index_;
-
- 452 <<
fleets[fleet_]->expected_index[year] << std::endl;
-
-
-
-
- 466 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
-
-
-
-
- 471 if (this->
fleets[fleet_]->is_survey ==
false) {
- 472 catch_ = (this->
fleets[fleet_]->Fmort[year] *
- 473 this->
fleets[fleet_]->selectivity->evaluate(
ages[age])) /
-
- 475 this->numbers_at_age[i_age_year] *
- 476 (1 - fims_math::exp(-(this->
mortality_Z[i_age_year])));
-
- 478 catch_ = (this->
fleets[fleet_]->selectivity->evaluate(
ages[age])) *
- 479 this->numbers_at_age[i_age_year];
-
-
-
-
- 484 << this->
fleets[fleet_]->selectivity->evaluate(
ages[age])
-
-
-
-
-
- 490 this->
fleets[fleet_]->catch_numbers_at_age[i_age_year] += catch_;
-
-
-
-
- 502 int i_age_year = year * this->nages + age;
- 503 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
-
-
- 506 << this->
fleets[fleet_]->catch_numbers_at_age[year] << std::endl;
-
- 508 this->
fleets[fleet_]->catch_weight_at_age[i_age_year] =
- 509 this->
fleets[fleet_]->catch_numbers_at_age[i_age_year] *
-
-
- 512 << this->
fleets[fleet_]->catch_weight_at_age[i_age_year]
-
-
-
-
-
-
-
-
- 528 POPULATION_LOG <<
" ages size " << this->ages.size() << std::endl;
-
- 530 POPULATION_LOG <<
"p mature" << this->proportion_mature_at_age[i_age_year]
-
-
- 533 this->proportion_mature_at_age[i_age_year] =
- 534 this->
maturity->evaluate(ages[age]);
-
- 536 POPULATION_LOG <<
"p mature set to " << this->proportion_mature_at_age[i_age_year]
-
-
+
+
+ 220 << this->
fleets[fleet_]->selectivity->evaluate(
ages[age])
+ 221 <<
" apical fishing mortality F for the fleet in year "
+ 222 << year <<
" is " << this->
fleets[fleet_]->Fmort[year]
+
+
+
+ 226 POPULATION_LOG <<
"M in calculate mortality is " << this->M[i_age_year]
+
+
+ 229 this->M[i_age_year] + this->mortality_F[i_age_year];
+
+
+
+
+
+ 242 this->numbers_at_age[i_age_year] =
+ 243 this->numbers_at_age[i_agem1_yearm1] *
+
+ 245 (fims_math::exp(-this->
mortality_Z[i_agem1_yearm1]));
+ 246 POPULATION_LOG <<
" z at i_agem1_yearm1 = " << i_agem1_yearm1 <<
" is "
+
+
+ 249 if (age == (this->nages - 1)) {
+ 250 this->numbers_at_age[i_age_year] =
+ 251 this->numbers_at_age[i_age_year] +
+ 252 this->numbers_at_age[i_agem1_yearm1 + 1] *
+ 253 (fims_math::exp(-this->
mortality_Z[i_agem1_yearm1 + 1]));
+
+
+
+
+ 265 size_t i_agem1_yearm1,
size_t age) {
+
+
+
+
+ 270 (fims_math::exp(-this->M[i_agem1_yearm1]));
+ 271 POPULATION_LOG <<
"survival rate at index " << i_agem1_yearm1 <<
" is "
+ 272 << fims_math::exp(-(this->M[i_agem1_yearm1])) << std::endl;
+
+
+ 275 if (age == (this->nages - 1)) {
+
+
+
+ 279 (fims_math::exp(-this->M[i_agem1_yearm1 + 1]));
+
+
+
+
+
+
+
+
+ 295 <<
" biomass inputs----- +++\n";
+
+
+
+ 307 this->unfished_biomass[year] +=
+
+
+
+
+ 319 this->spawning_biomass[year] +=
+ 320 this->proportion_female * this->numbers_at_age[i_age_year] *
+ 321 this->proportion_mature_at_age[i_age_year] * this->
weight_at_age[age];
+ 322 POPULATION_LOG <<
" proportion female " << this->proportion_female <<
" "
+ 323 <<
" mature age " << age <<
" is "
+ 324 << this->proportion_mature_at_age[i_age_year] <<
" "
+ 325 <<
" numbers at age " << this->numbers_at_age[i_age_year]
+
+ 327 <<
" growth " << this->weight_at_age[age] <<
" "
+ 328 <<
" spawning biomass " << this->spawning_biomass[year]
+
+ 330 <<
" spawning biomass inputs----- +++\n";
+
+
+
+
+ 343 this->unfished_spawning_biomass[year] +=
+
+ 345 this->proportion_mature_at_age[i_age_year] * this->
weight_at_age[age];
+
+
+
+ 354 std::vector<Type> numbers_spr(this->nages, 1.0);
+
+ 356 phi_0 += numbers_spr[0] * this->proportion_female *
+ 357 this->proportion_mature_at_age[0] *
+ 358 this->
growth->evaluate(ages[0]);
+ 359 for (
size_t a = 1; a < (this->nages - 1); a++) {
+ 360 numbers_spr[a] = numbers_spr[a - 1] * fims_math::exp(-this->M[a]);
+ 361 phi_0 += numbers_spr[a] * this->proportion_female *
+ 362 this->proportion_mature_at_age[a] *
+ 363 this->
growth->evaluate(ages[a]);
+
+
+ 366 numbers_spr[this->nages - 1] =
+ 367 (numbers_spr[
nages - 2] * fims_math::exp(-this->M[
nages - 2])) /
+ 368 (1 - fims_math::exp(-this->M[this->nages - 1]));
+ 369 phi_0 += numbers_spr[this->nages - 1] * this->proportion_female *
+ 370 this->proportion_mature_at_age[this->nages - 1] *
+ 371 this->
growth->evaluate(ages[this->nages - 1]);
+
+
+
+
+
+
+
+
+ 386 POPULATION_LOG <<
"spawning biomass = " << this->spawning_biomass[year]
+
+
+
+
+
+
+ 393 this->spawning_biomass[year - 1], phi0)
+
+ 395 this->numbers_at_age[i_age_year] =
+ 396 this->
recruitment->evaluate(this->spawning_biomass[year - 1], phi0) *
+
+ 398 this->expected_recruitment[year] = this->numbers_at_age[i_age_year];
+ 399 POPULATION_LOG <<
" numbers at age at indexya " << i_age_year <<
" is "
+ 400 << this->numbers_at_age[i_age_year] << std::endl;
+
+
+
+ 410 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
+ 411 if (this->
fleets[fleet_]->is_survey ==
false) {
+ 412 size_t index_yf = year * this->nfleets +
+
+ 414 size_t i_age_year = year * this->nages + age;
+
+ 416 POPULATION_LOG <<
" fleet " << fleet_ <<
" year " << year <<
" age "
+
+ 418 this->expected_catch[index_yf] +=
+ 419 this->
fleets[fleet_]->catch_weight_at_age[i_age_year];
+
+ 421 POPULATION_LOG <<
"expected catch: " << this->expected_catch[index_yf]
+
+ 423 POPULATION_LOG <<
"----------------------------------------------"
+
+
+ 426 fleets[fleet_]->expected_catch[year] +=
+ 427 this->
fleets[fleet_]->catch_weight_at_age[i_age_year];
+
+
+
+
+
+ 440 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
+
+
+ 443 if (this->
fleets[fleet_]->is_survey ==
false) {
+ 444 index_ = this->
fleets[fleet_]->catch_numbers_at_age[i_age_year] *
+
+
+ 447 POPULATION_LOG <<
"fleet " << fleet_ <<
" is a survey" << std::endl;
+ 448 index_ = this->
fleets[fleet_]->q *
+ 449 this->
fleets[fleet_]->selectivity->evaluate(
ages[age]) *
+ 450 this->numbers_at_age[i_age_year] *
+
+
+ 453 fleets[fleet_]->expected_index[year] += index_;
+
+ 455 <<
fleets[fleet_]->expected_index[year] << std::endl;
+
+
+
+
+ 469 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
+
+
+
+
+ 474 if (this->
fleets[fleet_]->is_survey ==
false) {
+ 475 catch_ = (this->
fleets[fleet_]->Fmort[year] *
+ 476 this->
fleets[fleet_]->selectivity->evaluate(
ages[age])) /
+
+ 478 this->numbers_at_age[i_age_year] *
+ 479 (1 - fims_math::exp(-(this->
mortality_Z[i_age_year])));
+
+ 481 catch_ = (this->
fleets[fleet_]->selectivity->evaluate(
ages[age])) *
+ 482 this->numbers_at_age[i_age_year];
+
+
+ 485 << this->
fleets[fleet_]->Fmort[year] << std::endl;
+
+ 487 << this->
fleets[fleet_]->selectivity->evaluate(
ages[age])
+
+
+
+
+
+ 493 this->
fleets[fleet_]->catch_numbers_at_age[i_age_year] += catch_;
+
+
+
+
+ 505 int i_age_year = year * this->nages + age;
+ 506 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
+
+
+ 509 << this->
fleets[fleet_]->catch_numbers_at_age[year]
+
+
+ 512 this->
fleets[fleet_]->catch_weight_at_age[i_age_year] =
+ 513 this->
fleets[fleet_]->catch_numbers_at_age[i_age_year] *
+
+
+ 516 << this->
fleets[fleet_]->catch_weight_at_age[i_age_year]
+
+
+
+
+
+
+
+
+ 532 POPULATION_LOG <<
" ages size " << this->ages.size() << std::endl;
+
+ 534 POPULATION_LOG <<
"p mature" << this->proportion_mature_at_age[i_age_year]
+
+
+ 537 this->proportion_mature_at_age[i_age_year] =
+ 538 this->
maturity->evaluate(ages[age]);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 568 for (
size_t y = 0; y <= this->
nyears; y++) {
- 569 for (
size_t a = 0; a < this->
nages; a++) {
-
-
-
-
- 574 size_t i_age_year = y * this->nages + a;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 541 << this->proportion_mature_at_age[i_age_year] << std::endl;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 572 for (
size_t y = 0; y <= this->
nyears; y++) {
+ 573 for (
size_t a = 0; a < this->
nages; a++) {
+
+
+
+
+ 578 size_t i_age_year = y * this->nages + a;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
- 635 this->expected_recruitment[i_age_year] =
- 636 this->numbers_at_age[i_age_year];
-
-
-
-
-
-
-
-
-
-
-
- 648 size_t i_agem1_yearm1 = (y - 1) *
nages + (a - 1);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 679 for (
size_t i = 0; i <
nyears; i++) {
- 680 for (
size_t j = 0; j <
nages; j++) {
-
-
-
-
-
-
- 687 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
- 688 for (
size_t i = 0; i <
nyears; i++) {
- 689 for (
size_t j = 0; j <
nages; j++) {
-
-
-
-
-
-
-
-
-
- 699 template <
class Type>
-
-
-
-
-
+
+
+
+
+ 639 this->expected_recruitment[i_age_year] =
+ 640 this->numbers_at_age[i_age_year];
+
+
+
+
+
+
+
+
+
+
+
+ 652 size_t i_agem1_yearm1 = (y - 1) *
nages + (a - 1);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 683 for (
size_t i = 0; i <
nyears; i++) {
+ 684 for (
size_t j = 0; j <
nages; j++) {
+
+
+
+
+
+
+ 691 for (
size_t fleet_ = 0; fleet_ < this->
nfleets; fleet_++) {
+ 692 for (
size_t i = 0; i <
nyears; i++) {
+ 693 for (
size_t j = 0; j <
nages; j++) {
+
+
+
+
+
+
+
+
+
+ 703 template <
class Type>
+
+
+
+
+
std::ofstream POPULATION_LOG("logs/population.log")
FIMSObject struct that defines member types and returns the unique id.
Definition: model_object.hpp:25
Population class. Contains subpopulations that are divided into generic partitions (eg....
Definition: population.hpp:36
@@ -649,42 +653,42 @@
int growth_id
Definition: population.hpp:93
size_t nyears
Definition: population.hpp:41
size_t nfleets
Definition: population.hpp:44
-void CalculateUnfishedSpawningBiomass(size_t i_age_year, size_t year, size_t age)
Adds to existing yearly unfished spawning biomass estimates the biomass for a specified year and age.
Definition: population.hpp:338
-void CalculateNumbersAA(size_t i_age_year, size_t i_agem1_yearm1, size_t age)
Calculates numbers at age at year and age specific indices.
Definition: population.hpp:237
-void CalculateSpawningBiomass(size_t i_age_year, size_t year, size_t age)
Calculates spawning biomass.
Definition: population.hpp:316
+void CalculateUnfishedSpawningBiomass(size_t i_age_year, size_t year, size_t age)
Adds to existing yearly unfished spawning biomass estimates the biomass for a specified year and age.
Definition: population.hpp:341
+void CalculateNumbersAA(size_t i_age_year, size_t i_agem1_yearm1, size_t age)
Calculates numbers at age at year and age specific indices.
Definition: population.hpp:239
+void CalculateSpawningBiomass(size_t i_age_year, size_t year, size_t age)
Calculates spawning biomass.
Definition: population.hpp:318
typename fims::ModelTraits< Type >::ParameterVector ParameterVector
Definition: population.hpp:39
-void Evaluate()
Executes the population loop.
Definition: population.hpp:544
+void Evaluate()
Executes the population loop.
Definition: population.hpp:548
std::vector< double > ages
Definition: population.hpp:58
std::vector< Type > proportion_mature_at_age
Definition: population.hpp:81
std::vector< Type > unfished_spawning_biomass
Definition: population.hpp:79
-void CalculateMaturityAA(size_t i_age_year, size_t age)
Calculates expected proportion of individuals mature at a selected ageage.
Definition: population.hpp:524
+void CalculateMaturityAA(size_t i_age_year, size_t age)
Calculates expected proportion of individuals mature at a selected ageage.
Definition: population.hpp:528
std::vector< Type > biomass
Definition: population.hpp:75
-void CalculateRecruitment(size_t i_age_year, size_t year)
Calculates expected recruitment for a given year.
Definition: population.hpp:379
+void CalculateRecruitment(size_t i_age_year, size_t year)
Calculates expected recruitment for a given year.
Definition: population.hpp:381
void Initialize(int nyears, int nseasons, int nages)
Initialize values. Called once at the start of model run.
Definition: population.hpp:125
-void CalculateBiomass(size_t i_age_year, size_t year, size_t age)
Calculates biomass.
Definition: population.hpp:288
+void CalculateBiomass(size_t i_age_year, size_t year, size_t age)
Calculates biomass.
Definition: population.hpp:290
std::vector< Type > spawning_biomass
Definition: population.hpp:76
int fleet_id
Definition: population.hpp:103
ParameterVector mortality_F
Definition: population.hpp:60
int recruitment_id
recruitment
Definition: population.hpp:88
-void CalculateUnfishedBiomass(size_t i_age_year, size_t year, size_t age)
Adds to existing yearly unfished biomass estimates the biomass for a specified year and age.
Definition: population.hpp:304
+void CalculateUnfishedBiomass(size_t i_age_year, size_t year, size_t age)
Adds to existing yearly unfished biomass estimates the biomass for a specified year and age.
Definition: population.hpp:306
std::shared_ptr< RecruitmentBase< Type > > recruitment
Definition: population.hpp:90
ParameterVector log_M
Definition: population.hpp:53
static uint32_t id_g
Definition: population.hpp:40
int maturity_id
Definition: population.hpp:98
size_t nages
Definition: population.hpp:43
-void CalculateCatchWeightAA(size_t year, size_t age)
Calculates expected catch weight at age for each fleet for a given year and age.
Definition: population.hpp:501
+void CalculateCatchWeightAA(size_t year, size_t age)
Calculates expected catch weight at age for each fleet for a given year and age.
Definition: population.hpp:504
std::vector< Type > unfished_biomass
Definition: population.hpp:77
-void CalculateUnfishedNumbersAA(size_t i_age_year, size_t i_agem1_yearm1, size_t age)
Calculates unfished numbers at age at year and age specific indices.
Definition: population.hpp:262
+void CalculateUnfishedNumbersAA(size_t i_age_year, size_t i_agem1_yearm1, size_t age)
Calculates unfished numbers at age at year and age specific indices.
Definition: population.hpp:264
std::vector< Type > expected_recruitment
Definition: population.hpp:86
-void CalculateCatchNumbersAA(size_t i_age_year, size_t year, size_t age)
Calculates catch in numbers at age for each fleet for a given year and age, then adds the value to th...
Definition: population.hpp:465
+void CalculateCatchNumbersAA(size_t i_age_year, size_t year, size_t age)
Calculates catch in numbers at age for each fleet for a given year and age, then adds the value to th...
Definition: population.hpp:468
std::vector< std::shared_ptr< Fleet< Type > > > fleets
Definition: population.hpp:105
-void CalculateIndex(size_t i_age_year, size_t year, size_t age)
Adds to the expected population indices by fleet.
Definition: population.hpp:436
+void CalculateIndex(size_t i_age_year, size_t year, size_t age)
Adds to the expected population indices by fleet.
Definition: population.hpp:439
void CalculateMortality(size_t i_age_year, size_t year, size_t age)
Calculates total mortality at an index, year, and age.
Definition: population.hpp:211
-void CalculateCatch(size_t year, size_t age)
Adds to exiting expected total catch by fleet in weight.
Definition: population.hpp:406
+void CalculateCatch(size_t year, size_t age)
Adds to exiting expected total catch by fleet in weight.
Definition: population.hpp:409
std::vector< double > years
Definition: population.hpp:59
std::vector< Type > mortality_Z
Definition: population.hpp:63
void CalculateInitialNumbersAA(size_t i_age_year, size_t a)
Calculates initial numbers at age for index and age.
Definition: population.hpp:199
-Type CalculateSBPR0()
Calculates equilibrium spawning biomass per recruit.
Definition: population.hpp:351
+Type CalculateSBPR0()
Calculates equilibrium spawning biomass per recruit.
Definition: population.hpp:353
std::vector< Type > weight_at_age
Definition: population.hpp:67
void Prepare()
Prepare to run the population loop. Called at each model iteration, and used to zero out derived quan...
Definition: population.hpp:156
std::vector< Type > log_init_naa
Definition: population.hpp:52
diff --git a/docs/rcpp__interface_8hpp_source.html b/docs/rcpp__interface_8hpp_source.html
index a478955..026935b 100644
--- a/docs/rcpp__interface_8hpp_source.html
+++ b/docs/rcpp__interface_8hpp_source.html
@@ -157,345 +157,346 @@
-
- 89 void clear_info_log() {
-
-
-
-
-
-
- 96 std::ofstream CLEAR_LOG(
"logs/info.log");
-
-
-
-
-
-
-
- 107 void clear_fims_log() {
-
- 109 std::ofstream CLEAR_LOG(
"logs/fims.log");
-
-
-
-
- 117 void clear_data_log() {
-
- 119 std::ofstream CLEAR_LOG(
"logs/data.log");
-
-
-
-
- 127 void clear_error_log() {
-
- 129 std::ofstream CLEAR_LOG(
"logs/error.log");
-
-
-
-
- 137 void clear_model_log() {
-
- 139 std::ofstream CLEAR_LOG(
"logs/model.log");
-
-
-
-
- 147 void clear_fleet_log() {
-
- 149 std::ofstream CLEAR_LOG(
"logs/fleet.log");
-
-
-
-
- 157 void clear_population_log() {
-
- 159 std::ofstream CLEAR_LOG(
"logs/population.log");
-
-
-
-
- 167 void clear_maturity_log() {
-
- 169 std::ofstream CLEAR_LOG(
"logs/maturity.log");
-
-
-
-
- 177 void clear_recruitment_log() {
-
- 179 std::ofstream CLEAR_LOG(
"logs/recruitment.log");
-
-
-
-
- 187 void clear_growth_log() {
-
- 189 std::ofstream CLEAR_LOG(
"logs/growth.log");
-
-
-
-
- 197 void clear_selectivity_log() {
-
- 199 std::ofstream CLEAR_LOG(
"logs/selectivity.log");
-
-
-
-
- 207 void clear_debug_log() {
-
- 209 std::ofstream CLEAR_LOG(
"logs/debug/debug.log");
-
-
-
-
-
-
-
-
-
-
-
-
- 225 clear_population_log();
- 226 clear_recruitment_log();
-
- 228 clear_maturity_log();
- 229 clear_selectivity_log();
-
-
-
- 233 template <
typename Type>
- 234 void clear_internal() {
- 235 std::shared_ptr<fims_info::Information<Type>> d0 =
-
- 237 d0->fixed_effects_parameters.clear();
- 238 d0->random_effects_parameters.clear();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 315 clear_internal<TMB_FIMS_REAL_TYPE>();
- 316 clear_internal<TMB_FIMS_FIRST_ORDER>();
- 317 clear_internal<TMB_FIMS_SECOND_ORDER>();
- 318 clear_internal<TMB_FIMS_THIRD_ORDER>();
-
-
-
-
- 323 Rcpp::function(
"CreateTMBModel", &CreateTMBModel);
- 324 Rcpp::function(
"get_fixed", &get_fixed_parameters_vector);
- 325 Rcpp::function(
"get_random", &get_random_parameters_vector);
- 326 Rcpp::function(
"clear", clear);
- 327 Rcpp::function(
"clear_logs", clear_logs);
- 328 Rcpp::function(
"clear_fims_log", clear_fims_log);
- 329 Rcpp::function(
"clear_info_log", clear_info_log);
- 330 Rcpp::function(
"clear_error_log", clear_error_log);
- 331 Rcpp::function(
"clear_data_log", clear_data_log);
- 332 Rcpp::function(
"clear_population_log", clear_population_log);
- 333 Rcpp::function(
"clear_model_log", clear_model_log);
- 334 Rcpp::function(
"clear_recruitment_log", clear_recruitment_log);
- 335 Rcpp::function(
"clear_fleet_log", clear_fleet_log);
- 336 Rcpp::function(
"clear_growth_log", clear_growth_log);
- 337 Rcpp::function(
"clear_maturity_log", clear_maturity_log);
- 338 Rcpp::function(
"clear_selectivity_log", clear_selectivity_log);
- 339 Rcpp::function(
"clear_debug_log", clear_debug_log);
-
- 341 Rcpp::class_<Parameter>(
"Parameter")
-
- 343 .constructor<
double>()
- 344 .constructor<Parameter>()
-
-
-
-
-
-
- 351 Rcpp::class_<BevertonHoltRecruitmentInterface>(
"BevertonHoltRecruitment")
-
-
-
-
- 356 .field(
"estimate_deviations",
-
-
- 359 .field(
"log_sigma_recruit",
-
-
-
-
- 364 Rcpp::class_<FleetInterface>(
"Fleet")
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 382 Rcpp::class_<AgeCompDataInterface>(
"AgeComp")
- 383 .constructor<int,
int>()
-
-
-
- 387 Rcpp::class_<IndexDataInterface>(
"Index")
-
-
-
-
- 392 Rcpp::class_<PopulationInterface>(
"Population")
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 411 Rcpp::class_<DnormDistributionsInterface>(
"TMBDnormDistribution")
-
-
-
-
-
-
-
- 419 Rcpp::class_<LogisticMaturityInterface>(
"LogisticMaturity")
-
-
-
-
-
-
- 426 Rcpp::class_<LogisticSelectivityInterface>(
"LogisticSelectivity")
-
-
-
-
-
-
- 433 Rcpp::class_<DoubleLogisticSelectivityInterface>(
"DoubleLogisticSelectivity")
-
-
+ 88 void clear_info_log() {
+
+
+
+
+
+
+ 95 std::ofstream CLEAR_LOG(
"logs/info.log");
+
+
+
+
+
+
+
+ 106 void clear_fims_log() {
+
+ 108 std::ofstream CLEAR_LOG(
"logs/fims.log");
+
+
+
+
+ 116 void clear_data_log() {
+
+ 118 std::ofstream CLEAR_LOG(
"logs/data.log");
+
+
+
+
+ 126 void clear_error_log() {
+
+ 128 std::ofstream CLEAR_LOG(
"logs/error.log");
+
+
+
+
+ 136 void clear_model_log() {
+
+ 138 std::ofstream CLEAR_LOG(
"logs/model.log");
+
+
+
+
+ 146 void clear_fleet_log() {
+
+ 148 std::ofstream CLEAR_LOG(
"logs/fleet.log");
+
+
+
+
+ 156 void clear_population_log() {
+
+ 158 std::ofstream CLEAR_LOG(
"logs/population.log");
+
+
+
+
+ 166 void clear_maturity_log() {
+
+ 168 std::ofstream CLEAR_LOG(
"logs/maturity.log");
+
+
+
+
+ 176 void clear_recruitment_log() {
+
+ 178 std::ofstream CLEAR_LOG(
"logs/recruitment.log");
+
+
+
+
+ 186 void clear_growth_log() {
+
+ 188 std::ofstream CLEAR_LOG(
"logs/growth.log");
+
+
+
+
+ 196 void clear_selectivity_log() {
+
+ 198 std::ofstream CLEAR_LOG(
"logs/selectivity.log");
+
+
+
+
+ 206 void clear_debug_log() {
+
+ 208 std::ofstream CLEAR_LOG(
"logs/debug/debug.log");
+
+
+
+
+
+
+
+
+
+
+
+ 223 clear_population_log();
+ 224 clear_recruitment_log();
+
+ 226 clear_maturity_log();
+ 227 clear_selectivity_log();
+
+
+
+ 231 template <
typename Type>
+ 232 void clear_internal() {
+ 233 std::shared_ptr<fims_info::Information<Type>> d0 =
+
+ 235 d0->fixed_effects_parameters.clear();
+ 236 d0->random_effects_parameters.clear();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 313 clear_internal<TMB_FIMS_REAL_TYPE>();
+ 314 clear_internal<TMB_FIMS_FIRST_ORDER>();
+ 315 clear_internal<TMB_FIMS_SECOND_ORDER>();
+ 316 clear_internal<TMB_FIMS_THIRD_ORDER>();
+
+
+
+
+ 321 Rcpp::function(
"CreateTMBModel", &CreateTMBModel);
+ 322 Rcpp::function(
"get_fixed", &get_fixed_parameters_vector);
+ 323 Rcpp::function(
"get_random", &get_random_parameters_vector);
+ 324 Rcpp::function(
"clear", clear);
+ 325 Rcpp::function(
"clear_logs", clear_logs);
+ 326 Rcpp::function(
"clear_fims_log", clear_fims_log);
+ 327 Rcpp::function(
"clear_info_log", clear_info_log);
+ 328 Rcpp::function(
"clear_error_log", clear_error_log);
+ 329 Rcpp::function(
"clear_data_log", clear_data_log);
+ 330 Rcpp::function(
"clear_population_log", clear_population_log);
+ 331 Rcpp::function(
"clear_model_log", clear_model_log);
+ 332 Rcpp::function(
"clear_recruitment_log", clear_recruitment_log);
+ 333 Rcpp::function(
"clear_fleet_log", clear_fleet_log);
+ 334 Rcpp::function(
"clear_growth_log", clear_growth_log);
+ 335 Rcpp::function(
"clear_maturity_log", clear_maturity_log);
+ 336 Rcpp::function(
"clear_selectivity_log", clear_selectivity_log);
+ 337 Rcpp::function(
"clear_debug_log", clear_debug_log);
+
+ 339 Rcpp::class_<Parameter>(
"Parameter")
+
+ 341 .constructor<
double>()
+ 342 .constructor<Parameter>()
+
+
+
+
+
+
+ 349 Rcpp::class_<BevertonHoltRecruitmentInterface>(
"BevertonHoltRecruitment")
+
+
+
+
+ 354 .field(
"estimate_deviations",
+
+
+ 357 .field(
"log_sigma_recruit",
+
+
+
+
+ 362 Rcpp::class_<FleetInterface>(
"Fleet")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 380 Rcpp::class_<AgeCompDataInterface>(
"AgeComp")
+ 381 .constructor<int,
int>()
+
+
+
+ 385 Rcpp::class_<IndexDataInterface>(
"Index")
+
+
+
+
+ 390 Rcpp::class_<PopulationInterface>(
"Population")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 409 Rcpp::class_<DnormDistributionsInterface>(
"TMBDnormDistribution")
+
+
+
+
+
+
+
+ 417 Rcpp::class_<LogisticMaturityInterface>(
"LogisticMaturity")
+
+
+
+
+
+
+ 424 Rcpp::class_<LogisticSelectivityInterface>(
"LogisticSelectivity")
+
+ 426 .field(
"inflection_point",
+
+
+
+
+
+ 432 Rcpp::class_<DoubleLogisticSelectivityInterface>(
"DoubleLogisticSelectivity")
+
+ 434 .field(
"inflection_point_asc",
+
-
-
-
-
-
- 442 Rcpp::class_<EWAAGrowthInterface>(
"EWAAgrowth")
-
-
-
-
-
-
- 449 Rcpp::class_<DlnormDistributionsInterface>(
"TMBDlnormDistribution")
-
-
-
-
-
-
-
- 457 Rcpp::class_<DmultinomDistributionsInterface>(
"TMBDmultinomDistribution")
-
-
-
-
-
-
-
-
+ 437 .field(
"inflection_point_desc",
+
+
+
+
+
+ 443 Rcpp::class_<EWAAGrowthInterface>(
"EWAAgrowth")
+
+
+
+
+
+
+ 450 Rcpp::class_<DlnormDistributionsInterface>(
"TMBDlnormDistribution")
+
+
+
+
+
+
+
+ 458 Rcpp::class_<DmultinomDistributionsInterface>(
"TMBDmultinomDistribution")
+
+
+
+
+
+
+
+
Rcpp::NumericVector age_comp_data
Definition: rcpp_data.hpp:65
virtual uint32_t get_id()
get the ID of the interface base object
Definition: rcpp_data.hpp:82
virtual double evaluate_nll()
evaluate recruitment nll
Definition: rcpp_recruitment.hpp:101
@@ -524,12 +525,12 @@
Parameter x
Definition: rcpp_tmb_distribution.hpp:66
Parameter sd
Definition: rcpp_tmb_distribution.hpp:68
virtual uint32_t get_id()
get_id method for child distribution interface objects to inherit
Definition: rcpp_tmb_distribution.hpp:72
-virtual double evaluate(double x)
evaluate the double logistic selectivity function
Definition: rcpp_selectivity.hpp:156
-virtual uint32_t get_id()
returns the id for the double logistic selectivity interface
Definition: rcpp_selectivity.hpp:150
-Parameter slope_asc
Definition: rcpp_selectivity.hpp:140
-Parameter inflection_point_asc
Definition: rcpp_selectivity.hpp:139
-Parameter slope_desc
Definition: rcpp_selectivity.hpp:143
-Parameter inflection_point_desc
Definition: rcpp_selectivity.hpp:142
+virtual double evaluate(double x)
evaluate the double logistic selectivity function
Definition: rcpp_selectivity.hpp:158
+virtual uint32_t get_id()
returns the id for the double logistic selectivity interface
Definition: rcpp_selectivity.hpp:152
+Parameter slope_asc
Definition: rcpp_selectivity.hpp:142
+Parameter inflection_point_asc
Definition: rcpp_selectivity.hpp:140
+Parameter slope_desc
Definition: rcpp_selectivity.hpp:145
+Parameter inflection_point_desc
Definition: rcpp_selectivity.hpp:143
virtual uint32_t get_id()
get the id of the GrowthInterfaceBase object
Definition: rcpp_growth.hpp:73
virtual double evaluate(double age)
Rcpp interface to the EWAAgrowth evaluate method you can call from R using ewaagrowth....
Definition: rcpp_growth.hpp:95
std::vector< double > weights
Definition: rcpp_growth.hpp:61
@@ -556,14 +557,14 @@
static uint32_t id_g
Definition: rcpp_growth.hpp:26
Rcpp::NumericVector index_data
Definition: rcpp_data.hpp:131
virtual uint32_t get_id()
get the ID of the interface base object
Definition: rcpp_data.hpp:145
-Parameter inflection_point
Definition: rcpp_maturity.hpp:63
-Parameter slope
Definition: rcpp_maturity.hpp:64
-virtual uint32_t get_id()
returns the id for the logistic maturity interface
Definition: rcpp_maturity.hpp:71
-virtual double evaluate(double x)
evaluate the logistic maturity function
Definition: rcpp_maturity.hpp:77
-Parameter slope
Definition: rcpp_selectivity.hpp:64
-Parameter inflection_point
Definition: rcpp_selectivity.hpp:63
-virtual uint32_t get_id()
returns the id for the logistic selectivity interface
Definition: rcpp_selectivity.hpp:71
-virtual double evaluate(double x)
evaluate the logistic selectivity function
Definition: rcpp_selectivity.hpp:77
+Parameter inflection_point
Definition: rcpp_maturity.hpp:64
+Parameter slope
Definition: rcpp_maturity.hpp:65
+virtual uint32_t get_id()
returns the id for the logistic maturity interface
Definition: rcpp_maturity.hpp:72
+virtual double evaluate(double x)
evaluate the logistic maturity function
Definition: rcpp_maturity.hpp:78
+Parameter slope
Definition: rcpp_selectivity.hpp:65
+Parameter inflection_point
Definition: rcpp_selectivity.hpp:64
+virtual uint32_t get_id()
returns the id for the logistic selectivity interface
Definition: rcpp_selectivity.hpp:72
+virtual double evaluate(double x)
evaluate the logistic selectivity function
Definition: rcpp_selectivity.hpp:78
static std::map< uint32_t, MaturityInterfaceBase * > live_objects
Definition: rcpp_maturity.hpp:30
static uint32_t id_g
Definition: rcpp_maturity.hpp:26
RcppInterface class that defines the interface between R and C++ for parameter types.
Definition: rcpp_interface_base.hpp:26
diff --git a/docs/rcpp__maturity_8hpp_source.html b/docs/rcpp__maturity_8hpp_source.html
index 28db0f3..30a5a22 100644
--- a/docs/rcpp__maturity_8hpp_source.html
+++ b/docs/rcpp__maturity_8hpp_source.html
@@ -122,77 +122,78 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 86 template <
typename Type>
- 87 bool add_to_fims_tmb_internal() {
- 88 std::shared_ptr<fims_info::Information<Type> > info =
-
-
- 91 std::shared_ptr<fims_popdy::LogisticMaturity<Type> > maturity =
- 92 std::make_shared<fims_popdy::LogisticMaturity<Type> >();
-
-
- 95 maturity->id = this->
id;
- 96 maturity->inflection_point = this->inflection_point.
value_m;
-
-
- 99 info->RegisterRandomEffect(maturity->inflection_point);
-
- 101 info->RegisterParameter(maturity->inflection_point);
-
-
- 104 maturity->slope = this->slope.
value_m;
-
-
- 107 info->RegisterRandomEffect(maturity->slope);
-
- 109 info->RegisterParameter(maturity->slope);
-
-
-
-
- 114 info->maturity_models[maturity->id] = maturity;
-
-
-
-
-
- 122 this->add_to_fims_tmb_internal<TMB_FIMS_REAL_TYPE>();
- 123 this->add_to_fims_tmb_internal<TMB_FIMS_FIRST_ORDER>();
- 124 this->add_to_fims_tmb_internal<TMB_FIMS_SECOND_ORDER>();
- 125 this->add_to_fims_tmb_internal<TMB_FIMS_THIRD_ORDER>();
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 87 template <
typename Type>
+ 88 bool add_to_fims_tmb_internal() {
+ 89 std::shared_ptr<fims_info::Information<Type> > info =
+
+
+ 92 std::shared_ptr<fims_popdy::LogisticMaturity<Type> > maturity =
+ 93 std::make_shared<fims_popdy::LogisticMaturity<Type> >();
+
+
+ 96 maturity->id = this->
id;
+
+
+
+ 100 info->RegisterRandomEffect(maturity->inflection_point);
+
+ 102 info->RegisterParameter(maturity->inflection_point);
+
+
+ 105 maturity->slope = this->slope.
value_m;
+
+
+ 108 info->RegisterRandomEffect(maturity->slope);
+
+ 110 info->RegisterParameter(maturity->slope);
+
+
+
+
+ 115 info->maturity_models[maturity->id] = maturity;
+
+
+
+
+
+ 123 this->add_to_fims_tmb_internal<TMB_FIMS_REAL_TYPE>();
+ 124 this->add_to_fims_tmb_internal<TMB_FIMS_FIRST_ORDER>();
+ 125 this->add_to_fims_tmb_internal<TMB_FIMS_SECOND_ORDER>();
+ 126 this->add_to_fims_tmb_internal<TMB_FIMS_THIRD_ORDER>();
+
+
+
+
+
+
+
+
Base class for all interface objects.
Definition: rcpp_interface_base.hpp:61
static std::vector< FIMSRcppInterfaceBase * > fims_interface_objects
Definition: rcpp_interface_base.hpp:64
virtual bool add_to_fims_tmb()
virtual method to inherit to add objects to the TMB model
Definition: rcpp_interface_base.hpp:67
Rcpp interface for logistic maturity as an S4 object. To instantiate from R: logistic_maturity <- new...
Definition: rcpp_maturity.hpp:61
-Parameter inflection_point
Definition: rcpp_maturity.hpp:63
-Parameter slope
Definition: rcpp_maturity.hpp:64
-virtual uint32_t get_id()
returns the id for the logistic maturity interface
Definition: rcpp_maturity.hpp:71
-virtual double evaluate(double x)
evaluate the logistic maturity function
Definition: rcpp_maturity.hpp:77
+Parameter inflection_point
Definition: rcpp_maturity.hpp:64
+Parameter slope
Definition: rcpp_maturity.hpp:65
+virtual uint32_t get_id()
returns the id for the logistic maturity interface
Definition: rcpp_maturity.hpp:72
+virtual double evaluate(double x)
evaluate the logistic maturity function
Definition: rcpp_maturity.hpp:78
MaturityInterfaceBase class should be inherited to define different Rcpp interfaces for each possible...
Definition: rcpp_maturity.hpp:24
virtual double evaluate(double x)=0
evaluate the function
static std::map< uint32_t, MaturityInterfaceBase * > live_objects
Definition: rcpp_maturity.hpp:30
diff --git a/docs/rcpp__population_8hpp_source.html b/docs/rcpp__population_8hpp_source.html
index 5298004..4deb0df 100644
--- a/docs/rcpp__population_8hpp_source.html
+++ b/docs/rcpp__population_8hpp_source.html
@@ -243,7 +243,7 @@
Rcpp::NumericVector log_M
Definition: rcpp_population.hpp:63
Population class. Contains subpopulations that are divided into generic partitions (eg....
Definition: population.hpp:36
-void Evaluate()
Executes the population loop.
Definition: population.hpp:544
+void Evaluate()
Executes the population loop.
Definition: population.hpp:548