We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13
ARMA MODEL
• Autoregressive Moving Average (ARMA)
models are used for modeling time series data. • They combine two components: an autoregressive (AR) part and a moving average (MA) part. Stationarity and Invertibility of ARMA Models • Stationarity • A time series is stationary if its statistical properties, such as mean and variance, do not change over time. • For an ARMA model to be stationary, the autoregressive (AR) part of the model must meet certain conditions. If all the roots of Eq. are less than one in absolute value, then ARMA(p, q) is stationary • Invertibility • Invertibility is a property of the moving average (MA) part of the ARMA model. • An MA process is invertible if it can be expressed as an infinite AR process, which ensures that past values and shocks can be recovered from current and past observations. If all the roots of Eq. are less than one in absolute value, then ARMA(p, q) is said to be invertible and has an infinite AR representation, • Checking Stationarity • Stationarity can be checked using: • Plots: Visual inspection of the time series plot. • Summary Statistics: Calculating rolling statistics (mean, variance) over time. • Statistical Tests: Using tests like the Augmented Dickey-Fuller (ADF) test. An increasing variogram suggests that the time series is non-stationary. • import numpy as np • import pandas as pd • import matplotlib.pyplot as plt
• # Function to compute the variogram
• def compute_variogram(series, max_lag): • n = len(series) • variogram = [] • for lag in range(1, max_lag + 1): • diff = (series[lag:] - series[:-lag]) ** 2 • variogram.append(0.5 * np.mean(diff)) • return variogram Checking for Stationarity using Variogram
• # Generate a stationary time series (white noise)
• # Compute the variogram for the stationary series
• max_lag = 20 • variogram_stationary = compute_variogram(stationary_series, max_lag) A flat variogram suggests that the time series is stationary. • # Plot the variogram for the stationary series • plt.figure(figsize=(10, 5)) • plt.plot(range(1, max_lag + 1), variogram_stationary, marker='o') • plt.title('Variogram of Stationary Time Series (White Noise)') • plt.xlabel('Lag') • plt.ylabel('Variogram') • plt.grid(True) • plt.show()