Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::utils::random::TransitionKernel< Time, Distribution > Class Template Reference

#include <quetzal/utils/random/TransitionKernel.hpp>

Detailed Description

template<typename Time, typename Distribution>
class quetzal::utils::random::TransitionKernel< Time, Distribution >

Time-variable discrete markovian transition kernel for sampling the next state knowing the present state \(x_0\).

Considering a Markov chain \((X_k)_{k\in Z_+}\) with discrete state space \(S\), and given each initial state \(x_0\) of \(S\), defines the markovian probability distribution at time \(t\) : \(P_t(X_1=\cdot|X_0=x_0)\), and samples the stochastic value \(X_1\), according to this probability law.

Template Parameters
Distributiontype of the transition kernels.

Public Types

using state_type = typename Distribution::result_type
 

Public Member Functions

 TransitionKernel ()
 Default constructor.
 
 TransitionKernel (state_type const &x, Time const &t, Distribution const &d)
 Initialize a transition kernel with a state/time couple and its associated distribution.
 
 TransitionKernel (state_type const &x, Time const &t, Distribution &&d)
 Initialize a transition kernel with a state/time couple and its associated distribution.
 
 TransitionKernel (const TransitionKernel &)=default
 Copy constructor.
 
 TransitionKernel (TransitionKernel &&)=default
 Move constructor.
 
TransitionKernel< Time, Distribution > & operator= (const TransitionKernel< Time, Distribution > &)=default
 Copy assignment operator.
 
TransitionKernel< Time, Distribution > & operator= (TransitionKernel< Time, Distribution > &&)=default
 Move assignment operator.
 
TransitionKernel< Time, Distribution > & set (state_type const &x, Time const &t, Distribution const &d)
 Set a probability distribution for a departure state and time.
 
TransitionKernel< Time, Distribution > & set (state_type const &x, Time const &t, Distribution &&d)
 Set a probability distribution for a departure state and time.
 
bool has_distribution (state_type const &x, Time const &t) const
 Checks if a probability distribution is associated to a departure state x at time t.
 
template<typename Generator >
state_type operator() (Generator &g, state_type const &x, Time const &t)
 Sample an arrival state conditionnaly to departure state and a time.
 

Constructor & Destructor Documentation

◆ TransitionKernel() [1/3]

quetzal::utils::random::TransitionKernel< Time, Distribution >::TransitionKernel ( state_type const x,
Time const t,
Distribution const d 
)
inline

Initialize a transition kernel with a state/time couple and its associated distribution.

Parameters
xthe departure state
tthe departure time
dthe probability distribution on the arrival state

◆ TransitionKernel() [2/3]

quetzal::utils::random::TransitionKernel< Time, Distribution >::TransitionKernel ( state_type const x,
Time const t,
Distribution &&  d 
)
inline

Initialize a transition kernel with a state/time couple and its associated distribution.

Parameters
xthe departure state
tthe departure time

◆ TransitionKernel() [3/3]

Move constructor.

Example

Member Function Documentation

◆ has_distribution()

bool quetzal::utils::random::TransitionKernel< Time, Distribution >::has_distribution ( state_type const x,
Time const t 
) const
inline

Checks if a probability distribution is associated to a departure state x at time t.

Returns
true if a distribution is defined, else returns false.
Parameters
xthe departure state.
tthe departure time.

◆ operator()()

template<typename Generator >
state_type quetzal::utils::random::TransitionKernel< Time, Distribution >::operator() ( Generator g,
state_type const x,
Time const t 
)
inline

Sample an arrival state conditionnaly to departure state and a time.

Returns
the arrival state.
Parameters
xthe departure state.
tthe departure time.

◆ set() [1/2]

template<typename Time , typename Distribution >
TransitionKernel< Time, Distribution > & quetzal::utils::random::TransitionKernel< Time, Distribution >::set ( state_type const &  x,
Time const &  t,
Distribution &&  d 
)
inline

Set a probability distribution for a departure state and time.

Parameters
xthe departure state.
tthe departure time.
dthe associated probability distribution.

◆ set() [2/2]

template<typename Time , typename Distribution >
TransitionKernel< Time, Distribution > & quetzal::utils::random::TransitionKernel< Time, Distribution >::set ( state_type const &  x,
Time const &  t,
Distribution const &  d 
)
inline

Set a probability distribution for a departure state and time.

Parameters
xthe departure state
tthe departure time
dthe associated probability distribution.

The documentation for this class was generated from the following file: