Learn R Programming

pmhtutorial (version 1.0.0)

generateData: Generates data from a linear Gaussian state space model

Description

Generates data from a specific linear Gaussian state space model of the form \( x_{t} = \phi x_{t-1} + \sigma_v v_t \) and \( y_t = x_t + \sigma_e e_t \), where \(v_t\) and \(e_t\) denote independent standard Gaussian random variables, i.e. \(N(0,1)\).

Usage

generateData(phi, sigmav, sigmae, T, x0)

Arguments

phi

The parameter \(\phi\) that scales the current state in the state dynamics. It is restricted to [-1,1] to obtain a stable model.

sigmav

The standard deviation of the state process noise. Must be positive.

sigmae

The standard deviation of the observation process noise. Must be positive.

T

The number of time points to simulate.

x0

The initial state.

Value

The function returns a list with the elements:

  • x: The latent state for \(t=0,...,T\).

  • y: The observation for \(t=0,...,T\).

References

Dahlin, J. & Schoen, T. B. "Getting started with particle Metropolis-Hastings for inference in nonlinear dynamical models." pre-print, arXiv:1511.01707, 2015.