ssmkit  master-68aed98
Hierarchical< Args > Class Template Reference

A stochastic process constructed as hierarchy of stochastic processes. More...

Public Types

using TRandomVAR = std::tuple< typename ProcessTraits< Args >::TRandomVAR...>
 Type of the random variable. More...
 

Public Member Functions

 Hierarchical (Args...processes)
 Constructor. More...
 
TRandomVAR initialize ()
 Initialize process. More...
 
template<class... TVARs>
TRandomVAR random (const TVARs &...args)
 Sample random variable. More...
 
template<class... TArgs>
double likelihood (const TRandomVAR &rvs, const TArgs &...args)
 Calculate likelihood. More...
 
template<size_t L>
std::tuple_element< L,
std::tuple< Args...> >::type & 
getProcess ()
 get a reference to the process at level L More...
 
- Public Member Functions inherited from BaseProcess< Hierarchical< Args...> >
decltype(auto) random_n (const size_t &n, const TArgs &...args)
 

Detailed Description

template<class... Args>
class ssmkit::process::Hierarchical< Args >

A stochastic process constructed as hierarchy of stochastic processes.

A hierarchical dynamic Bayesian network is constructed by vertically stacking layers of stochastic processes such that in every time-slice a layer is only dependent on its immediate upper layer.

hierarchical.png
Dynamic Bayesian Network model of Hierarchical process
Template Parameters
Args...Type of the process levels

Definition at line 31 of file hierarchical.hpp.

Member Typedef Documentation

using TRandomVAR = std::tuple<typename ProcessTraits<Args>::TRandomVAR...>

Type of the random variable.

This is a tuple of the random variables of every layer in top-down order \((\mathbf{x}_k^0, \cdots, \mathbf{x}_k^L)\).

Definition at line 46 of file hierarchical.hpp.

Constructor & Destructor Documentation

Hierarchical ( Args...  processes)
inline

Constructor.

Construct a Hierarchical process object from a sequence of processes. The first control variable of every process layer other than first one \((y^{1,0}, \cdots, y^{L,0})\) is used to connect upper layer to lower layer.

Note
use makeHierarchical for convenient template argument deduction
Parameters
[in]processes... Process objects of each level in top-down order
Precondition
Except the first process layer every other layer depends on its upper layer. The first control variable of all the process object other than first one is used to connect layers. Thus, it should have the same type as the upper layer random variable. Otherwise compilation will fail.

Definition at line 66 of file hierarchical.hpp.

Member Function Documentation

TRandomVAR initialize ( )
inline

Initialize process.

Initialize and return initial random variable of all layers.

Definition at line 72 of file hierarchical.hpp.

TRandomVAR random ( const TVARs &...  args)
inline

Sample random variable.

Sample one random variable from all layers \((\mathbf{x}_k^0, \cdots, \mathbf{x}_k^L)\).

Parameters
[in]args... Control variables in top-down order \((y^{0,0}_k, \cdots, y^{0,N^0}_k, y^{1,0}_k, \cdots, y^{1,N^1}_k, \cdots, y^{L,0}_k, \cdots, y^{L,N^L}_k)\)
Returns
\((\mathbf{x}_k^0, \cdots, \mathbf{x}_k^L)\)
Side Effects
the method calls random method of every process layer. Depending on type of the process layer its internal state may changes.

Definition at line 90 of file hierarchical.hpp.

double likelihood ( const TRandomVAR rvs,
const TArgs &...  args 
)
inline

Calculate likelihood.

calculate likelihood of one random variable \((\mathbf{x}_k^0, \cdots, \mathbf{x}_k^L)\) given internal states \((\mathbf{x}_{k-1}^0, \cdots, \mathbf{x}_{k-1}^L)\) and control variables \((y^{0,0}_k, \cdots, y^{0,N^0}_k, y^{1,0}_k, \cdots, y^{1,N^1}_k, \cdots, y^{L,0}_k, \cdots, y^{L,N^L}_k)\)

Parameters
[in]rvsrandom variable whose likelihood is calculated \((\mathbf{x}_k^0, \cdots, \mathbf{x}_k^L)\)
[in]args... Control variables in top-down order \((y^{0,0}_k, \cdots, y^{0,N^0}_k, y^{1,0}_k, \cdots, y^{1,N^1}_k, \cdots, y^{L,0}_k, \cdots, y^{L,N^L}_k)\)
Returns
Likelihood of rvs

Definition at line 120 of file hierarchical.hpp.

std::tuple_element<L, std::tuple<Args...> >::type& getProcess ( )
inline

get a reference to the process at level L

Example
// get the second level process of hierarchical_process
second_level = hierarchical_process.getProcess<1>()

Definition at line 140 of file hierarchical.hpp.


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