Learn R Programming

TSSS (version 1.2.3)

ngsim: Simulation by Non-Gaussian State Space Model

Description

Simulation by non-Gaussian state space model.

Usage

ngsim(n = 200, trend = NULL, seasonal.order = 0, seasonal = NULL, arcoef = NULL, 
      ar = NULL, noisew = 1, wminmax = c(-1, 1), paramw = NULL, noisev = 1, 
      vminmax = c(-1, 1), paramv = NULL, seed = NULL, plot = TRUE, …)

Arguments

n

the number of simulated data.

trend

initial values of trend component of length at most 2.

seasonal.order

seasonal order. (0 or 1)

seasonal

if seasonal.order > 0, initial values of seasonal component of length \(p-1\), where \(p\) is the number of season in one period.

arcoef

AR coefficients.

ar

initial values of AR component.

noisew

type of the observational noise.

-1 : Cauchy random number (without an inverse function)
-2 : exponential distribution (without an inverse function)
-3 : double exponential distribution (without an inverse function)
0 : double exponential distribution (+ Euler's constant)
1 : normal distribution,
2 : Pearson distribution,

wminmax

lower and upper bound of observational noise.

paramw

parameter of the observational noise density.

noisew = 1 : variance

noisev

type of the system noise.

-1 : Cauchy random number (without an inverse function)
-2 : exponential distribution (without an inverse function)
-3 : double exponential distribution (without an inverse function)
0 : double exponential distribution (+ Euler's constant)
1 : normal distribution
2 : Pearson distribution

vminmax

lower and upper bound of system noise.

paramv

parameter of the system noise density.

noisev = 1 : variance

seed

arbitrary positive integer to generate a sequence of uniform random numbers. The default seed is based on the current time.

plot

logical. If TRUE (default), simulated data are plotted.

…

further arguments to be passed to plot.simulate.

Value

An object of class "simulate", giving simulated data of non-Gaussian state space model.

References

Kitagawa, G. (2010) Introduction to Time Series Modeling. Chapman & Hall/CRC.

Examples

Run this code
# NOT RUN {
ar1 <- ngsim(n = 400, arcoef = 0.95, noisew = 1, paramw = 1, noisev = 1,
             paramv = 1, seed = 555)
plot(ar1, use = c(201, 400))

ar2 <- ngsim(n = 400, arcoef = c(1.3, -0.8), noisew = 1, paramw = 1, noisev = 1,
             paramv = 1, seed = 555)
plot(ar2, use = c(201, 400))


# }

Run the code above in your browser using DataLab