decomp {timsac} | R Documentation |
Time Series Decomposition (Seasonal Adjustment) by Square-Root Filter
Description
Decompose a nonstationary time series into several possible components by square-root filter.
Usage
decomp(y, trend.order = 2, ar.order = 2, seasonal.order = 1,
period = 1, log = FALSE, trade = FALSE, diff = 1,
miss = 0, omax = 99999.9, plot = TRUE, ...)
Arguments
y |
a univariate time series with or without the tsp attribute. | ||||||
trend.order |
trend order (1, 2 or 3). | ||||||
ar.order |
AR order (less than 11, try 2 first). | ||||||
seasonal.order |
seasonal order (0, 1 or 2). | ||||||
period |
number of seasons in one period. If the tsp attribute of
| ||||||
log |
logical; if | ||||||
trade |
logical; if | ||||||
diff |
numerical differencing (1 sided or 2 sided). | ||||||
miss |
missing value flag.
| ||||||
omax |
maximum or minimum data value (if | ||||||
plot |
logical. If | ||||||
... |
graphical arguments passed to |
Details
The Basic Model
where is trend component,
is AR process,
is
seasonal component,
is trading day factor and
is
observational noise.
Component Models
Trend component (trend.order m1)
AR component (ar.order m2)
Seasonal component (seasonal.order k, frequency f)
Trading day effect
where
is the number of
-th days of the week in
-th data and
.
Value
An object of class "decomp"
, which is a list with the following
components:
trend |
trend component. |
seasonal |
seasonal component. |
ar |
AR process. |
trad |
trading day factor. |
noise |
observational noise. |
aic |
AIC. |
lkhd |
likelihood. |
sigma2 |
sigma^2. |
tau1 |
system noise variances |
tau2 |
system noise variances |
tau3 |
system noise variances |
arcoef |
vector of AR coefficients. |
tdf |
trading day factor. |
conv.y |
Missing values are replaced by NA after the specified logarithmic transformation.. |
References
G.Kitagawa (1981) A Nonstationary Time Series Model and Its Fitting by a Recursive Filter Journal of Time Series Analysis, Vol.2, 103-116.
W.Gersch and G.Kitagawa (1983) The prediction of time series with Trends and Seasonalities Journal of Business and Economic Statistics, Vol.1, 253-264.
G.Kitagawa (1984) A smoothness priors-state space modeling of Time Series with Trend and Seasonality Journal of American Statistical Association, VOL.79, NO.386, 378-389.
Examples
data(Blsallfood)
y <- ts(Blsallfood, start=c(1967,1), frequency=12)
z <- decomp(y, trade = TRUE)
z$aic
z$lkhd
z$sigma2
z$tau1
z$tau2
z$tau3