Multivariate Point Process Package  0.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Poisson Class Reference

Poisson implements the multivariate homogeneous process. More...

#include "include/Poisson.h"

Inheritance diagram for Poisson:
IProcess

Public Member Functions

 Poisson (const unsigned &n, const unsigned &num_dims)
 The constructor. More...
 
virtual void NegLoglikelihood (double &objvalue, Eigen::VectorXd &Gradient)
 Negative loglikelihood of homogeneous Poisson process. More...
 
virtual double Intensity (const double &t, const Sequence &data, Eigen::VectorXd &intensity_dim)
 The intensity of each dimension for a homogeneous Poisson process is a constant \(\lambda^0_n\). More...
 
virtual double IntensityUpperBound (const double &t, const double &L, const Sequence &data, Eigen::VectorXd &intensity_upper_dim)
 Returns the upper bound of the summation of the intensity value on each dimension from time t to t + L given the history of past events in sequence data. Let \({\lambda_d^*(t)}\) be the conditional intensity function on the d-th dimension where \(d=1\dotso D\), and num_dims_ = D. This function returns

\begin{align} \lambda_0^D(t) \geq \sum_{d=1}^D\sup_{\tau\in[t, t + \tau(t)]}\lambda^*_d(\tau), \end{align}

where the returned value \(\lambda_0^D(t)\) will be used for Ogata's Thinning algorithm. More...

 
virtual double IntensityIntegral (const double &lower, const double &upper, const Sequence &data)
 Returns the integral of the intensity function \(\int_{a}^b\lambda^*(\tau)d\tau\) where \(a = lower\) and \(b = upper\). More...
 
virtual void Gradient (const unsigned &k, Eigen::VectorXd &gradient)
 Returns the gradient w.r.t. the model parameters on the k-th sequence. More...
 
virtual double PredictNextEventTime (const Sequence &data, const unsigned &num_simulations)
 Predict the next event timing by the expectation \(\int_{t_n}^\infty tf^*(t)dt\). Currently, we use the sample average by simulations to approximate the expectation since the conditional density \(f^*(t)\) normally does not have an analytic form. More...
 
void fit (const std::vector< Sequence > &data)
 Maximum likelihood estimation for the model parameters. More...
 
- Public Member Functions inherited from IProcess
 IProcess (const unsigned &n, const unsigned &num_dims)
 The constructor. More...
 
const Eigen::VectorXd & GetParameters ()
 Return the column vector of model parameters. More...
 
unsigned GetNumDims ()
 Return the number of dimensions in the process. More...
 
void SetParameters (const Eigen::VectorXd &v)
 Set the model parameters. More...
 
void PlotIntensityFunction (const Sequence &data)
 Plots the intensity functions based on the given sequence. It plots the intensity function and the associated event points up of each dimension in the same figure. More...
 
void PlotIntensityFunction (const Sequence &data, const unsigned &dim_id)
 Plots the intensity function and the associated event points of the dimension dim_id. More...
 

Protected Member Functions

void Initialize (const std::vector< Sequence > &data)
 initialize the temporal features intensity_features_ and intensity_itegral_features_ from the input sequences. More...
 
- Protected Member Functions inherited from IProcess
void InitializeDimension (const std::vector< Sequence > &data)
 

Protected Attributes

Eigen::VectorXd intensity_features_
 A column vector where each component is the average number of events on each dimension. More...
 
double intensity_itegral_features_
 The average observation windown. More...
 
unsigned num_sequences_
 total number of observed sequences More...
 
Eigen::VectorXd observation_window_T_
 a column vector of length \(C\) which is the total number of sequences. Each component records the observation window in the respective sequence. More...
 
- Protected Attributes inherited from IProcess
Eigen::VectorXd parameters_
 A column vector represents all model parameters of the process. More...
 
unsigned num_dims_
 The total number of dimensions of the process. More...
 
std::vector< std::vector< std::vector< double > > > all_timestamp_per_dimension_
 all_timestamp_per_dimension_ is a 3-d array where all_timestamp_per_dimension_[c][n][i] records the i-th event on the n-th dimension in the c-th sequence. More...
 

Detailed Description

Poisson implements the multivariate homogeneous process.

Definition at line 17 of file Poisson.h.

Constructor & Destructor Documentation

Poisson::Poisson ( const unsigned &  n,
const unsigned &  num_dims 
)
inline

The constructor.

Parameters
[in]nthe number of parameters in total.
[in]num_dimsthe number of dimensions in the process.

Definition at line 55 of file Poisson.h.

Member Function Documentation

void Poisson::fit ( const std::vector< Sequence > &  data)

Maximum likelihood estimation for the model parameters.

Parameters
[in]datavectors of observed sequences.

Definition at line 92 of file Poisson.cc.

void Poisson::Gradient ( const unsigned &  k,
Eigen::VectorXd &  gradient 
)
virtual

Returns the gradient w.r.t. the model parameters on the k-th sequence.

Parameters
[in]ksequence index.
[out]gradientthe gradient vector w.r.t. the model parameters.

Implements IProcess.

Definition at line 75 of file Poisson.cc.

void Poisson::Initialize ( const std::vector< Sequence > &  data)
protected

initialize the temporal features intensity_features_ and intensity_itegral_features_ from the input sequences.

Parameters
[in]datainput collection of sequences

Definition at line 24 of file Poisson.cc.

double Poisson::Intensity ( const double &  t,
const Sequence data,
Eigen::VectorXd &  intensity_dim 
)
virtual

The intensity of each dimension for a homogeneous Poisson process is a constant \(\lambda^0_n\).

Parameters
[in]tthe given time.
[in]datathe given sequence of the past events until time t.
[out]intensity_dima column vector of size num_dims_ where each component stores the intensity value of the respetive dimension at time t given the past sequence in data.
Returns
the summation of the intensity value from each dimension.

Implements IProcess.

Definition at line 10 of file Poisson.cc.

double Poisson::IntensityIntegral ( const double &  lower,
const double &  upper,
const Sequence data 
)
virtual

Returns the integral of the intensity function \(\int_{a}^b\lambda^*(\tau)d\tau\) where \(a = lower\) and \(b = upper\).

Parameters
[in]lowerstarting point of the integral.
[in]upperending point of the integral.
[in]datasequence of past events.
Returns
\(\int_{a}^b\lambda^*(\tau)d\tau\) where \(a = lower\) and \(b = upper\).

Implements IProcess.

Definition at line 99 of file Poisson.cc.

double Poisson::IntensityUpperBound ( const double &  t,
const double &  L,
const Sequence data,
Eigen::VectorXd &  intensity_upper_dim 
)
virtual

Returns the upper bound of the summation of the intensity value on each dimension from time t to t + L given the history of past events in sequence data. Let \({\lambda_d^*(t)}\) be the conditional intensity function on the d-th dimension where \(d=1\dotso D\), and num_dims_ = D. This function returns

\begin{align} \lambda_0^D(t) \geq \sum_{d=1}^D\sup_{\tau\in[t, t + \tau(t)]}\lambda^*_d(\tau), \end{align}

where the returned value \(\lambda_0^D(t)\) will be used for Ogata's Thinning algorithm.

Parameters
tthe starting time.
Lthe duration.
datathe given sequence of the past events until time t.
intensity_upper_dima column vector of size num_dims_ storing the upper bound of the intensity function on each dimension from time t to t + L.
Returns
the summation of the upper-bound of each intensity function from the respetive dimension within the interval [t, t + L].

Implements IProcess.

Definition at line 19 of file Poisson.cc.

void Poisson::NegLoglikelihood ( double &  objvalue,
Eigen::VectorXd &  Gradient 
)
virtual

Negative loglikelihood of homogeneous Poisson process.

\begin{align} -\frac{1}{C}\sum_{c=1}^C\bigg\{\sum_{n=1}^D (\sum_{i=1}^{n_c}\log\lambda^0_n - T_c\lambda^0_n) \bigg\} \end{align}

Parameters
objvaluenegative loglikelihood.
gradientgradient of the parameters.

Implements IProcess.

Definition at line 60 of file Poisson.cc.

double Poisson::PredictNextEventTime ( const Sequence data,
const unsigned &  num_simulations 
)
virtual

Predict the next event timing by the expectation \(\int_{t_n}^\infty tf^*(t)dt\). Currently, we use the sample average by simulations to approximate the expectation since the conditional density \(f^*(t)\) normally does not have an analytic form.

Parameters
[in]datathe sequence of past events.
[in]num_simulationsnumber of simulations we use to calculate the sample average.
Returns
the prediction of the next event timing.

Implements IProcess.

Definition at line 105 of file Poisson.cc.

Member Data Documentation

Eigen::VectorXd Poisson::intensity_features_
protected

A column vector where each component is the average number of events on each dimension.

Definition at line 25 of file Poisson.h.

double Poisson::intensity_itegral_features_
protected

The average observation windown.

Definition at line 30 of file Poisson.h.

unsigned Poisson::num_sequences_
protected

total number of observed sequences

Definition at line 35 of file Poisson.h.

Eigen::VectorXd Poisson::observation_window_T_
protected

a column vector of length \(C\) which is the total number of sequences. Each component records the observation window in the respective sequence.

Definition at line 46 of file Poisson.h.


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