Learn R Programming

exdqlm (version 0.4.0)

seasMod: Create Fourier representation of a periodic exDQLM component

Description

The function creates a Fourier form periodic component for given period and harmonics.

Usage

seasMod(p, h, m0, C0, backend = c("auto", "R", "cpp"))

Value

An object of class "exdqlm" containing the following:

  • FF - \(q \times 1\) observational vector.

  • GG - \(q \times q\) evolution matrix.

  • m0 - \(q \times 1\) prior mean of the state vector.

  • C0 - \(q \times q\) prior covariance matrix of the state vector.

Arguments

p

Numeric period.

h

Numeric vector of harmonics to be included.

m0

Optional numeric prior mean. Defaults to \(q \times 1\) vector of zeros where \(q\) is the dimension of the period component.

C0

Optional numeric prior covariance. Defaults to matrix \(10^3 I_q\).

backend

Backend selection for matrix construction: "auto" (default), "R", or "cpp".

Examples

Run this code
# create a seasonal component with first, second and fourth harmonics of a period of 365
seas.comp = seasMod(365, c(1, 2, 4), C0 = 10*diag(6))

Run the code above in your browser using DataLab