data.gen.LGSS: Linear Gaussian state-space model

Description Usage Arguments Value References Examples

View source: R/data_gen_SS.R

Description

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

Usage

1
2
3
4
5
6
data.gen.LGSS(
  theta,
  nobs,
  start = runif(n = 1, min = -1, max = 1),
  do.plot = TRUE
)

Arguments

theta

The parameters θ=\{φ,σ_v,σ_e\} of the LGSS model.

nobs

The data length to be generated.

start

A numeric value indicating the starting value for the time series. If the starting point is not specified, it is generated randomly.

do.plot

Logical value. If TRUE (default value), a plot of the generated LGSS system is shown.

Value

A list of two variables, state and response.

References

#Dahlin, J. & Schon, T. B. 'Getting Started with Particle Metropolis-Hastings for Inference in Nonlinear Dynamical Models.' Journal of Statistical Software, Code Snippets, 88(2): 1–41, 2019.

Examples

1
data.LGSS <- data.gen.LGSS(theta=c(0.75,1.00,0.10), nobs=500, start=0)

synthesis documentation built on May 3, 2021, 9:07 a.m.