| dlmModTrig {dlm} | R Documentation |
The function creates a dlm representing a specified periodic component.
dlmModTrig(s, q, om, tau, m0, C0, dV = 1, dW = 0)
s |
The period, if integer. |
q |
Number of harmonics in the DLM. |
om |
The frequency. |
tau |
The period, if not an integer. |
m0 |
m0 |
C0 |
C0 |
dV |
Variance of the observational noise. |
dW |
A single number expressing the variance of the system noise. |
The periodic component is specified by one and only one of s,
om, and tau. When s is given, the function
assumes that the period is an integer, while a period specified by
tau is assumed to be noninteger. Instead of tau,
the frequency om can be specified. The argument q
specifies the number of harmonics to include in the model. When
tau or omega is given, then q is required as
well, since in this case the implied Fourier representation has
infinitely many harmonics. On the other hand, if s is given,
q defaults to all the harmonics in the Fourier representation,
that is floor(s/2).
The system variance of the resulting dlm is dW times the identity
matrix of the appropriate dimension.
An object of class dlm, representing a periodic component.
Giovanni Petris, GPetris@uark.edu
West and Harrison, Bayesian forecasting and dynamic models (2nd ed.), Springer, 1997.
dlmModSeas, dlmModARMA,
dlmModPoly, dlmModReg
dlmModTrig(s = 3) dlmModTrig(tau = 3, q = 1) # same thing dlmModTrig(s = 4) # for quarterly data dlmModTrig(s = 4, q = 1) dlmModTrig(tau = 4, q = 2) # a bad idea! m1 <- dlmModTrig(tau = 6.3, q = 2); m1 m2 <- dlmModTrig(om = 2 * pi / 6.3, q = 2) all.equal(unlist(m1), unlist(m2))