ExponentialSurvivalFunction< FP > Struct Template Reference

CPP API: mio::ExponentialSurvivalFunction< FP > Struct Template Reference
mio::ExponentialSurvivalFunction< FP > Struct Template Reference

Class that defines the survival function corresponding to the exponential distribution depending on the state age. More...

#include <state_age_function.h>

Inheritance diagram for mio::ExponentialSurvivalFunction< FP >:
Collaboration diagram for mio::ExponentialSurvivalFunction< FP >:

Public Member Functions

FP eval (FP state_age) override
 Defines exponential decay function depending on state_age. More...
 
 ExponentialSurvivalFunction (FP init_distribution_parameter, FP init_location=0)
 Constructs a new ExponentialSurvivalFunction object. More...
 
FP get_mean (FP dt=1.0, FP tol=1e-10) override
 Computes the mean value of the function. More...
 
- Public Member Functions inherited from mio::StateAgeFunction< FP >
std::unique_ptr< StateAgeFunction< FP > > clone () const
 Clones unique pointer to a StateAgeFunction. More...
 
FP get_distribution_parameter () const
 Get the m_distribution_parameter object. More...
 
FP get_location () const
 Get the m_location object. More...
 
FP get_scale () const
 Get the m_scale object. More...
 
std::string get_state_age_function_type () const
 Get type of StateAgeFunction, i.e.which derived class is used. More...
 
virtual FP get_support_max (FP dt, FP tol=1e-10)
 Computes the maximum of the support of the function using the time step size dt and some tolerance tol. More...
 
StateAgeFunction< FP > & operator= (const StateAgeFunction< FP > &other)=default
 Copy assignment operator. More...
 
StateAgeFunction< FP > & operator= (StateAgeFunction< FP > &&other)=default
 Move assignment operator. More...
 
bool operator== (const StateAgeFunction< FP > &other) const
 Comparison operator. More...
 
void set_distribution_parameter (FP new_distribution_parameter)
 Set the m_distribution_parameter object. More...
 
void set_location (FP new_location)
 Set the m_location object. More...
 
void set_scale (FP new_scale)
 Set the m_scale object. More...
 
 StateAgeFunction (const StateAgeFunction< FP > &other)=default
 Copy constructor. More...
 
 StateAgeFunction (FP init_distribution_parameter, FP init_location=0, FP init_scale=1)
 Constructs a new StateAgeFunction object. More...
 
 StateAgeFunction (StateAgeFunction< FP > &&other)=default
 Move constructor. More...
 
virtual ~StateAgeFunction ()=default
 Virtual destructor. More...
 

Protected Member Functions

StateAgeFunction< FP > * clone_impl () const override
 Implements clone for ExponentialSurvivalFunction. More...
 

Additional Inherited Members

- Protected Attributes inherited from mio::StateAgeFunction< FP >
FP m_distribution_parameter
 Parameter for function in derived class. More...
 
FP m_location
 Location parameter for function in derived class. More...
 
FP m_mean
 Mean value of the function. More...
 
FP m_mean_tol {-1.0}
 Tolerance for computation of the mean (initialize as not set). More...
 
FP m_scale
 Scale parameter for function in derived class. More...
 
FP m_support_max
 Maximum of the support of the function. More...
 
FP m_support_tol {-1.0}
 Tolerance for computation of the support (initialize as not set). More...
 

Detailed Description

template<typename FP>
struct mio::ExponentialSurvivalFunction< FP >

Class that defines the survival function corresponding to the exponential distribution depending on the state age.

Constructor & Destructor Documentation

◆ ExponentialSurvivalFunction()

template<typename FP >
mio::ExponentialSurvivalFunction< FP >::ExponentialSurvivalFunction ( FP  init_distribution_parameter,
FP  init_location = 0 
)
inline

Constructs a new ExponentialSurvivalFunction object.

Parameters
[in]init_distribution_parameterSpecifies the initial function parameter of the function.
[in]init_locationLocation parameter to shift the ExponentialSurvivalFunction function. Should be a positive number to fulfill characteristics of a TransitionDistribution.

Member Function Documentation

◆ clone_impl()

template<typename FP >
StateAgeFunction<FP>* mio::ExponentialSurvivalFunction< FP >::clone_impl ( ) const
inlineoverrideprotectedvirtual

Implements clone for ExponentialSurvivalFunction.

Returns
Pointer to StateAgeFunction.

Implements mio::StateAgeFunction< FP >.

◆ eval()

template<typename FP >
FP mio::ExponentialSurvivalFunction< FP >::eval ( FP  state_age)
inlineoverridevirtual

Defines exponential decay function depending on state_age.

m_distribution_parameter defines how fast the exponential function decays.

Parameters
[in]state_ageTime at which the function is evaluated.
Returns
Evaluation of the function at state_age.

Implements mio::StateAgeFunction< FP >.

◆ get_mean()

template<typename FP >
FP mio::ExponentialSurvivalFunction< FP >::get_mean ( FP  dt = 1.0,
FP  tol = 1e-10 
)
inlineoverridevirtual

Computes the mean value of the function.

For the exponential distribution, the mean value is the reciprocal of the distribution parameter and shifted with respect to the location parameter.

Parameters
[in]dtTime step size used for the numerical integration (unused for ExponentialSurvivalFunction).
[in]tolThe maximum support used for numerical integration is calculated using this tolerance (unused for ExponentialSurvivalFunction).
Returns
ScalarType mean value.

Reimplemented from mio::StateAgeFunction< FP >.