Season: Specify a seasonal effect in a DLM prior.

View source: R/SpecPrior-generators.R

SeasonR Documentation

Specify a seasonal effect in a DLM prior.

Description

A DLM prior can contain a seasonal effect, which is specified using function Season. Season effects can can change over time.

Usage

Season(n, scale = HalfT())

Arguments

n

Number of seasons. An integer greater than 1.

scale

Prior for the scaleSeason parameter. An object of class HalfT.

Details

In a prior for a main effect, the seasonal effect has the form

s[j] = s[j-n] + errorSeason[j],

where n is the number of seasons.

In a prior for an interaction, the seasonal effect has the form

s[k,l] = s[k-n,l] + errorSeason[k,l].

(See the documentation for function DLM for an explanation of the k,l subscripts.)

The error term has the form

errorSeason[j] ~ N(0, scaleSeason^2)

or

errorSeason[k,l] ~ N(0, scaleSeason^2).

Standard deviation scaleSeason has a half-t prior, which can be specified using function HalfT. Season effects are not fixed, but instead evolve over time. The speed with which season effects change is governed by scaleSeason.

Value

An object of class Season

See Also

Season supplies an option argument to function DLM.

Examples

Season(n = 4)
Season(n = 2, scale = HalfT(scale = 3))

StatisticsNZ/demest documentation built on Nov. 2, 2023, 7:56 p.m.