pfilter {TSSS} | R Documentation |
Particle Filtering and Smoothing
Description
Trend estimation by particle filter and smoother.
Usage
pfilter(y, m = 10000, model = 0, lag = 20, initd = 0, sigma2, tau2,
alpha = 0.99, bigtau2 = NULL, init.sigma2 = 1, xrange = NULL,
seed = NULL, plot = TRUE, ...)
Arguments
y |
univariate time series. | ||||||||||
m |
number of particles. | ||||||||||
model |
model for the system noise.
| ||||||||||
lag |
lag length for fixed-lag smoothing. | ||||||||||
initd |
type of initial state distribution.
| ||||||||||
sigma2 |
observation noise variance | ||||||||||
tau2 |
system noise variance | ||||||||||
alpha |
mixture weight | ||||||||||
bigtau2 |
variance of the second component | ||||||||||
init.sigma2 |
variance for | ||||||||||
xrange |
specify the lower and upper bounds of the distribution's range. | ||||||||||
seed |
arbitrary positive integer to generate a sequence of uniform random numbers. The default seed is based on the current time. | ||||||||||
plot |
logical. If | ||||||||||
... |
graphical arguments passed to the |
Details
This function performs particle filtering and smoothing for the first order trend model;
x_n = x_{n-1} + v_n, | (system model) |
y_n = x_n + w_n, | (observation model) |
where y_n
is a time series, x_n
is the state vector.
The system noise v_n
and the observation noise w_n
are assumed to be white noises
which follow a Gaussian distribution or a Cauchy distribution, and non-Gaussian distribution, respectively.
The algorithm of the particle filter and smoother are presented in Kitagawa (2020). For more details, please refer to Kitagawa (1996) and Doucet et al. (2001).
Value
An object of class "pfilter"
which has a plot
method. This is a
list with the following components:
llkhood |
log-likelihood. | ||||||||||||
smooth.dist |
marginal smoothed distribution of the trend
|
References
Kitagawa, G. (1996) Monte Carlo filter and smoother for non-Gaussian nonlinear state space models, J. of Comp. and Graph. Statist., 5, 1-25.
Doucet, A., de Freitas, N. and Gordon, N. (2001) Sequential Monte Carlo Methods in Practice, Springer, New York.
Kitagawa, G. (2020) Introduction to Time Series Modeling with Applications in R. Chapman & Hall/CRC.
See Also
pfilterNL
performs particle filtering and smoothing for nonlinear
non-Gaussian state-space model.
Examples
data(PfilterSample)
y <- PfilterSample
## Not run:
pfilter(y, m = 100000, model = 0, lag = 20, initd = 0, sigma2 = 1.048,
tau2 = 1.4e-2, xrange = c(-4, 4), seed = 2019071117)
pfilter(y, m = 100000, model = 1, lag = 20 , initd = 0, sigma2 = 1.045,
tau2 = 3.53e-5, xrange = c(-4, 4), seed = 2019071117)
pfilter(y, m = 100000, model = 2, lag = 20 , initd = 0, sigma2 = 1.03,
tau2 = 0.00013, alpha = 0.991, xrange = c(-4, 4), seed = 2019071117)
## End(Not run)