Class 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
    • EYt = 0
    • st+d = st
    • Σ(sj) = 0
    The R equivalent function is decompose.
    • Constructor Summary

      Constructors 
      Constructor Description
      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.
    • 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
      • 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