The Rcpp interface for Dnorm to instantiate from R: dnorm_ <- methods::new(DnormDistribution).
More...
#include <rcpp_distribution.hpp>
|
|
| DnormDistributionsInterface () |
| | The constructor.
|
| |
| | DnormDistributionsInterface (const DnormDistributionsInterface &other) |
| | Construct a new Dnorm Distributions Interface object.
|
| |
|
virtual | ~DnormDistributionsInterface () |
| | The destructor.
|
| |
| virtual uint32_t | get_id () |
| | Gets the ID of the interface base object.
|
| |
| virtual bool | set_observed_data (int observed_data_id) |
| | Set the unique ID for the observed data object.
|
| |
| virtual bool | set_distribution_mean (double input_value) |
| | Set the expected mean value for the distribution.
|
| |
| virtual bool | set_distribution_links (std::string input_type, Rcpp::IntegerVector ids) |
| | Sets pointers for data observations, random effects, or priors.
|
| |
| virtual double | evaluate () |
| | Evaluate normal probability density function (pdf). The natural log of the pdf is returned.
|
| |
| virtual void | finalize () |
| | Extracts the derived quantities from Information to the Rcpp object.
|
| |
| virtual std::string | to_json () |
| | Converts the data to json representation for the output.
|
| |
|
| DistributionsInterfaceBase () |
| | The constructor.
|
| |
| | DistributionsInterfaceBase (const DistributionsInterfaceBase &other) |
| | Construct a new Distributions Interface Base object.
|
| |
|
virtual | ~DistributionsInterfaceBase () |
| | The destructor.
|
| |
| virtual bool | add_to_fims_tmb () |
| | A virtual method to inherit to add objects to the TMB model.
|
| |
| std::string | value_to_string (double value) |
| | Report the variable value as a string.
|
| |
|
std::string | make_dimensions (uint32_t start, uint32_t end, uint32_t rep=1) |
| | Make a string of dimensions for the model.
|
| |
|
|
VariableVector | observed_values |
| | Observed data.
|
| |
|
VariableVector | expected_values |
| | The expected values, which would be the mean of x for this distribution.
|
| |
|
VariableVector | expected_mean |
| | The expected mean, which would be the mean of x for this distribution.
|
| |
|
VariableVector | log_sd |
| | The uncertainty, which would be the standard deviation of x for the normal distribution.
|
| |
| RealVector | lpdf_vec |
| | Vector that records the individual log probability function for each observation.
|
| |
|
uint32_t | id_m |
| | The local ID of the DistributionsInterfaceBase object.
|
| |
|
std::shared_ptr< std::vector< uint32_t > > | key_m |
| | The unique ID for the variable map that points to a fims::Vector.
|
| |
|
SharedString | input_type_m |
| | The type of density input. The options are prior, re, or data.
|
| |
| SharedString | use_mean_m = fims::to_string("no") |
| | Control flag indicating whether to use the expected mean in the distribution calculations.
|
| |
|
SharedInt | interface_observed_data_id_m = -999 |
| | The ID of the observed data object, which is set to -999.
|
| |
|
double | lpdf_value = 0 |
| | The log probability density function value.
|
| |
|
bool | finalized = false |
| | Is the object already finalized? The default is false.
|
| |
The Rcpp interface for Dnorm to instantiate from R: dnorm_ <- methods::new(DnormDistribution).
◆ DnormDistributionsInterface()
Construct a new Dnorm Distributions Interface object.
- Parameters
-
◆ evaluate()
| virtual double DnormDistributionsInterface::evaluate |
( |
| ) |
|
|
inlinevirtual |
Evaluate normal probability density function (pdf). The natural log of the pdf is returned.
- Returns
- The natural log of the probability density function (pdf) is returned.
Implements DistributionsInterfaceBase.
◆ finalize()
| virtual void DnormDistributionsInterface::finalize |
( |
| ) |
|
|
inlinevirtual |
Extracts the derived quantities from Information to the Rcpp object.
Reimplemented from FIMSRcppInterfaceBase.
◆ get_id()
| virtual uint32_t DnormDistributionsInterface::get_id |
( |
| ) |
|
|
inlinevirtual |
◆ set_distribution_links()
| virtual bool DnormDistributionsInterface::set_distribution_links |
( |
std::string |
input_type, |
|
|
Rcpp::IntegerVector |
ids |
|
) |
| |
|
inlinevirtual |
Sets pointers for data observations, random effects, or priors.
- Parameters
-
| input_type | String that sets whether the distribution type is for priors, random effects, or data. |
| ids | Vector of unique ids for each linked parameter(s), derived value(s), or observed data vector. |
Reimplemented from DistributionsInterfaceBase.
◆ set_distribution_mean()
| virtual bool DnormDistributionsInterface::set_distribution_mean |
( |
double |
input_value | ) |
|
|
inlinevirtual |
Set the expected mean value for the distribution.
This virtual function provides an interface for setting a fixed mean value for distribution objects. When overridden in derived classes, this method typically stores the provided mean value as a fixed effect parameter and marks the distribution to use the mean in its calculations.
The base class implementation returns false to indicate the operation is not supported. Derived classes that support mean specification should override this method to implement the actual functionality.
- Parameters
-
| input_value | The numeric value to set as the distribution's expected mean. This value will be treated as a fixed effect parameter (not estimated) in derived class implementations. |
- Returns
- bool Returns true if the mean was successfully set, false otherwise. The base class implementation always returns false to indicate the operation is not supported by default.
- See also
- DnormDistributionsInterface::set_distribution_mean for an example implementation that sets the mean as a fixed effect parameter.
Reimplemented from DistributionsInterfaceBase.
◆ set_observed_data()
| virtual bool DnormDistributionsInterface::set_observed_data |
( |
int |
observed_data_id | ) |
|
|
inlinevirtual |
Set the unique ID for the observed data object.
- Parameters
-
| observed_data_id | Unique ID for the observed data object. |
Reimplemented from DistributionsInterfaceBase.
◆ to_json()
| virtual std::string DnormDistributionsInterface::to_json |
( |
| ) |
|
|
inlinevirtual |
Converts the data to json representation for the output.
- Returns
- A string is returned specifying that the module relates to the distribution interface with a normal distribution. It also returns the ID and the natural log of the probability density function values themselves. This string is formatted for a json file.
Reimplemented from FIMSRcppInterfaceBase.
◆ lpdf_vec
Vector that records the individual log probability function for each observation.
The vector
The documentation for this class was generated from the following file: