![]() |
FIMS
v0.8.1
|
The Rcpp interface to declare things. More...
#include "../../common/model.hpp"#include "../../utilities/fims_json.hpp"#include "rcpp_objects/rcpp_data.hpp"#include "rcpp_objects/rcpp_distribution.hpp"#include "rcpp_objects/rcpp_fleet.hpp"#include "rcpp_objects/rcpp_growth.hpp"#include "rcpp_objects/rcpp_interface_base.hpp"#include "rcpp_objects/rcpp_maturity.hpp"#include "rcpp_objects/rcpp_models.hpp"#include "rcpp_objects/rcpp_natural_mortality.hpp"#include "rcpp_objects/rcpp_population.hpp"#include "rcpp_objects/rcpp_recruitment.hpp"#include "rcpp_objects/rcpp_selectivity.hpp"Go to the source code of this file.
Functions | |
| void | init_logging () |
| bool | CreateTMBModel () |
| Initialize and construct the FIMS model using TMB. | |
| void | set_fixed_parameters (Rcpp::NumericVector par) |
| Update fixed parameters in the tape, so the output is correct. | |
| Rcpp::NumericVector | get_fixed_parameters_vector () |
| Gets the fixed parameters vector object. | |
| void | set_random_parameters (Rcpp::NumericVector par) |
| Update random effect parameters in the tape, so the output is correct. | |
| Rcpp::NumericVector | get_random_parameters_vector () |
| Gets the random parameters vector object. | |
| Rcpp::List | get_parameter_names (Rcpp::List pars) |
| Gets the parameter names object. | |
| Rcpp::List | get_random_names (Rcpp::List pars) |
| Gets the random effects names object. | |
| template<typename Type > | |
| void | clear_internal () |
| Clears the internal objects. | |
| void | clear () |
| Clears the vector of independent variables. | |
| std::string | get_log () |
| Gets the log entries as a string in JSON format. | |
| std::string | get_log_errors () |
| Gets the error entries from the log as a string in JSON format. | |
| std::string | get_log_warnings () |
| Gets the warning entries from the log as a string in JSON format. | |
| std::string | get_log_info () |
| Gets the info entries from the log as a string in JSON format. | |
| void | write_log (bool write) |
| If true, writes the log on exit. | |
| void | set_log_path (const std::string &path) |
| Sets the path for the log file to be written to. | |
| void | set_log_throw_on_error (bool throw_on_error) |
| If true, throws a runtime exception when an error is logged. | |
| void | log_info (std::string log_entry) |
| Adds an info entry to the log from the R environment. | |
| void | log_warning (std::string log_entry) |
| Adds a warning entry to the log from the R environment. | |
| std::string | escapeQuotes (const std::string &input) |
| Escapes quotations. | |
| void | log_error (std::string log_entry) |
| Adds a error entry to the log from the R environment. | |
The Rcpp interface to declare things.
| void clear_internal | ( | ) |
Clears the internal objects.
| Type |
| bool CreateTMBModel | ( | ) |
Initialize and construct the FIMS model using TMB.
This function sets up the core C++ objects required for building the objective function with TMB before optimizing a FIMS model. The main steps of the function are as follows:
Typically the average user does not interact with this function because it is called within initialize_fims.
initialize_fims() | std::string escapeQuotes | ( | const std::string & | input | ) |
Escapes quotations.
| input | A string. |
| Rcpp::NumericVector get_fixed_parameters_vector | ( | ) |
Gets the fixed parameters vector object.
| Rcpp::List get_parameter_names | ( | Rcpp::List | pars | ) |
Gets the parameter names object.
| pars |
| Rcpp::List get_random_names | ( | Rcpp::List | pars | ) |
Gets the random effects names object.
| pars |
| Rcpp::NumericVector get_random_parameters_vector | ( | ) |
Gets the random parameters vector object.
| void init_logging | ( | ) |
Initializes the logging system, setting all signal handling.
| void set_fixed_parameters | ( | Rcpp::NumericVector | par | ) |
Update fixed parameters in the tape, so the output is correct.
Updates the internal parameter values for the model base of type TMB_FIMS_REAL_TYPE. It is typically called before finalize() or `get_output()` to ensure the correct values are used because TMB doesn't always keep the updated parameters in the "double" version of the tape. So we need to update those first.
Usage example in R:
| par | A vector of parameter values. |
| void set_random_parameters | ( | Rcpp::NumericVector | par | ) |
Update random effect parameters in the tape, so the output is correct.
Updates the internal parameter values for the model base of type TMB_FIMS_REAL_TYPE. It is typically called before finalize() or `get_output()` to ensure the correct values are used because TMB doesn't always keep the updated parameters in the "double" version of the tape. So we need to update those first.
Usage example in R:
| par | A vector of parameter values. |