FIMS  v0.8.0
Loading...
Searching...
No Matches
DlnormDistributionsInterface Class Reference

The Rcpp interface for Dlnorm to instantiate from R: dlnorm_ <- methods::new(DlnormDistribution). More...

#include <rcpp_distribution.hpp>

Inheritance diagram for DlnormDistributionsInterface:
DistributionsInterfaceBase FIMSRcppInterfaceBase

Public Member Functions

 DlnormDistributionsInterface ()
 The constructor.
 
 DlnormDistributionsInterface (const DlnormDistributionsInterface &other)
 Construct a new Dlnorm Distributions Interface object.
 
virtual ~DlnormDistributionsInterface ()
 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_links (std::string input_type, Rcpp::IntegerVector ids)
 Sets pointers for data observations, random effects, or priors.
 
virtual double evaluate ()
 Evaluate lognormal 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.
 
- Public Member Functions inherited from DistributionsInterfaceBase
 DistributionsInterfaceBase ()
 The constructor.
 
 DistributionsInterfaceBase (const DistributionsInterfaceBase &other)
 Construct a new Distributions Interface Base object.
 
virtual ~DistributionsInterfaceBase ()
 The destructor.
 
virtual bool set_distribution_mean (double input_value)
 Set the expected mean value for the distribution.
 
- Public Member Functions inherited from FIMSRcppInterfaceBase
virtual bool add_to_fims_tmb ()
 A virtual method to inherit to add objects to the TMB model.
 
void get_se_values (std::string name, std::map< std::string, std::vector< double > > &se_values, fims::Vector< double > &values)
 Method to extract standard error values from the se_values working map.
 
virtual void set_uncertainty (std::map< std::string, std::vector< double > > &se_values)
 Set uncertainty values for the interface object.
 
std::string value_to_string (double value)
 Report the parameter 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.
 

Public Attributes

ParameterVector x
 Observed data.
 
ParameterVector expected_values
 The expected values, which would be the mean of log(x) for this distribution.
 
ParameterVector log_sd
 The uncertainty, which would be the natural logarithm of the standard deviation (sd) of log(x) for this distribution. The natural log of the standard deviation is necessary because the exponential link function is applied to the log transformed standard deviation to insure standard deviation is positive.
 
RealVector lpdf_vec
 Vector that records the individual log probability function for each observation.
 
- Public Attributes inherited from DistributionsInterfaceBase
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.
 
- Public Attributes inherited from FIMSRcppInterfaceBase
bool finalized = false
 Is the object already finalized? The default is false.
 

Additional Inherited Members

- Static Public Attributes inherited from DistributionsInterfaceBase
static uint32_t id_g = 1
 The static ID of the DistributionsInterfaceBase object.
 
static std::map< uint32_t, std::shared_ptr< DistributionsInterfaceBase > > live_objects
 The map associating the ID of the DistributionsInterfaceBase to the DistributionsInterfaceBase objects. This is a live object, which is an object that has been created and lives in memory.
 
- Static Public Attributes inherited from FIMSRcppInterfaceBase
static std::vector< std::shared_ptr< FIMSRcppInterfaceBase > > fims_interface_objects
 FIMS interface object vectors.
 

Detailed Description

The Rcpp interface for Dlnorm to instantiate from R: dlnorm_ <- methods::new(DlnormDistribution).

Constructor & Destructor Documentation

◆ DlnormDistributionsInterface()

DlnormDistributionsInterface::DlnormDistributionsInterface ( const DlnormDistributionsInterface other)
inline

Construct a new Dlnorm Distributions Interface object.

Parameters
other

Member Function Documentation

◆ evaluate()

virtual double DlnormDistributionsInterface::evaluate ( )
inlinevirtual

Evaluate lognormal 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 DlnormDistributionsInterface::finalize ( )
inlinevirtual

Extracts the derived quantities from Information to the Rcpp object.

Reimplemented from FIMSRcppInterfaceBase.

◆ get_id()

virtual uint32_t DlnormDistributionsInterface::get_id ( )
inlinevirtual

Gets the ID of the interface base object.

Returns
The ID.

Implements DistributionsInterfaceBase.

◆ set_distribution_links()

virtual bool DlnormDistributionsInterface::set_distribution_links ( std::string  input_type,
Rcpp::IntegerVector  ids 
)
inlinevirtual

Sets pointers for data observations, random effects, or priors.

Parameters
input_typeString that sets whether the distribution type is for priors, random effects, or data.
idsVector of unique ids for each linked parameter(s), derived value(s), or observed data vector.

Reimplemented from DistributionsInterfaceBase.

◆ set_observed_data()

virtual bool DlnormDistributionsInterface::set_observed_data ( int  observed_data_id)
inlinevirtual

Set the unique ID for the observed data object.

Parameters
observed_data_idUnique ID for the observed data object.

Reimplemented from DistributionsInterfaceBase.

◆ to_json()

virtual std::string DlnormDistributionsInterface::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 log_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.

Member Data Documentation

◆ lpdf_vec

RealVector DlnormDistributionsInterface::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: