SuanShu, a Java numerical and statistical library



com.numericalmethod.suanshu.stats.timeseries.linear.univariate.stationaryprocess
Class MADecomposition

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.timeseries.linear.univariate.stationaryprocess.MADecomposition

public class MADecomposition
extends Object

This class decomposes a time series into the trend, seasonal and stationary random components using the Moving Average Estimation method with symmetric window. That is,

Xt = mt + st + Yt
We have The R equivalent function is decompose.

See Also:
"P. J. Brockwell and R. A. Davis, "p. 23, Chapter 1.4, Elimination of both Trend and Seasonality," Time Series: Theory and Methods, 2nd ed, Springer, 2006."

Constructor Summary
MADecomposition(double[] xt, double[] MAFilter, int period)
          Decompose a time series into the trend, seasonal and stationary random components using the Moving Average Estimation method.
MADecomposition(double[] xt, int period)
          Decompose a periodic time series into the seasonal and stationary random components using no MA filter.
MADecomposition(double[] xt, int MAOrder, int period)
          Decompose a time series into the trend, seasonal and stationary random components using the default filter.
 
Method Summary
 double[] getRandom()
          Get the estimated seasonal effect of the time series.
 double[] getSeasonal()
          Get the stationary random component of the time series after the trend and seasonal components are removed.
 double[] getTrend()
          Get the estimated trend of the time series.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MADecomposition

public MADecomposition(double[] xt,
                       double[] MAFilter,
                       int period)
Decompose a time series into the trend, seasonal and stationary random components using the Moving Average Estimation method.

Parameters:
xt - a time series
MAFilter - the moving average filter to smooth the time series
period - the period of the time series; if aperiodic, use 1

MADecomposition

public MADecomposition(double[] xt,
                       int MAOrder,
                       int period)
Decompose a time series into the trend, seasonal and stationary random components using the default filter.

Parameters:
xt - a time series
MAOrder - the length of the MA filter (automatically increased by 1 for even MAOrder)
period - the period of the time series; if aperiodic, use 0
See Also:
"P. J. Brockwell and R. A. Davis, "Eq. 1.4.16, Chapter 1.4, Elimination of both Trend and Seasonality," Time Series: Theory and Methods, 2nd ed, Springer, 2006."

MADecomposition

public MADecomposition(double[] xt,
                       int period)
Decompose a periodic time series into the seasonal and stationary random components using no MA filter.

Parameters:
xt - a time series
period - the period of the time series; if aperiodic, use 0
Method Detail

getTrend

public double[] getTrend()
Get the estimated trend of the time series.

Returns:
the estimated trend

getSeasonal

public double[] getSeasonal()
Get the stationary random component of the time series after the trend and seasonal components are removed.

Returns:
the stationary random component

getRandom

public double[] getRandom()
Get the estimated seasonal effect of the time series.

Returns:
the estimated seasonal effect


Copyright © 2010-2014 Numerical Method Incorporation Limited. All Rights Reserved.