Decompose a nonstationary time series into several possible components by square-root filter.
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, ...)
An object of class "decomp"
, which is a list with the following
components:
trend component.
seasonal component.
AR process.
trading day factor.
observational noise.
AIC.
likelihood.
sigma^2.
system noise variances
system noise variances
system noise variances
vector of AR coefficients.
trading day factor. tdf(i)
(i=1,7) are from Sunday to
Saturday sequentially.
Missing values are replaced by NA after the specified logarithmic transformation..
a univariate time series with or without the tsp attribute.
trend order (1, 2 or 3).
AR order (less than 11, try 2 first).
seasonal order (0, 1 or 2).
number of seasons in one period. If the tsp attribute of
y
is not NULL
, frequency(y)
.
logical; if TRUE
, a log scale is in use.
logical; if TRUE
, the model including trading day effect
component is concidered, where tsp(y)
is not null and
frequency(y)
is 4 or 12.
numerical differencing (1 sided or 2 sided).
missing value flag.
= 0 : | no consideration |
> 0 : | values which are greater than omax are treated as
missing data |
< 0 : | values which are less than omax are treated as missing
data |
maximum or minimum data value (if miss
> 0 or miss
<
0).
logical. If TRUE
(default), trend
, seasonal
,
ar
and trad
are plotted.
graphical arguments passed to plot.decomp
.
The Basic Model
Component Models
Trend component (trend.order m1)
AR component (ar.order m2)
Seasonal component (seasonal.order k, frequency f)
Trading day effect
where
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.
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
Run the code above in your browser using DataLab