R in Time Series: Linear Regression With Harmonic Seasonality

This tutorial talks about linear regression with harmonic seasonality.

1  Underlying mathematics

In regression modeling with seasonality, we can use one parameter for each season. For instance, 12 parameters for 12 months in one year. However, seasonal effects often vary smoothly over the seasons, so that it may be more parameter-efficient to use a smooth function instead of separate indices. Sine and cosine functions can be used to build smooth variationinto a seasonal model. Read more R in Time Series: Linear Regression With Harmonic Seasonality

R in Time Series: Linear Regression with Seasonal Variables

This tutorial gives a short introduction about linear regression with seasonal variables.

A time series are observations measured sequentially in time, seasonal effects are often present in the data, especially annual cycles caused directly or indirectly by the Earth’s movement around the sun. Here we will present linear regression model with additive seasonal indicator variables included.

Suppose a time series contains s seasons. For example

  • For time series measured over each calendar month, s = 12.
  • For time series measured in six-month intevals, corresponding to summer and winter, s = 2.

Read more R in Time Series: Linear Regression with Seasonal Variables

R in Time Series: Seasonal Decomposition By Loess

This tutorial talks about how to do seasonal decomposition by Loess.

The Seasonal Trend Decomposition using Loess (STL) is an algorithm that was developed to help to divide up a time series into three components namely: the trend, seasonality and remainder. The methodology was presented by Robert Cleveland, William Cleveland, Jean McRae and Irma Terpenning in the Journal of Official Statistics in 1990. This paper can be downloaded here. Read more R in Time Series: Seasonal Decomposition By Loess

R in Time Series: Seasonal Decomposition By Moving Average

This tutorial tells about how to do seasonal decomposition by moving average in R.

There are two kinds of classical decomposition models:

  1. Additive model: \(x_t=m_t+s_t+\epsilon_t\)
  2. Multiplicative model: \(x_t=m_t\cdot s_t+\epsilon_t\)

Read more R in Time Series: Seasonal Decomposition By Moving Average