Skip to contents

Fit a subset PAR model with trigonometric parameterisation.

Usage

fit_trigPAR_optim(x, order, nseasons, seasonof1st = 1, maxiter = 200, 
                  harmonics = NULL, sintercept = FALSE, tol = 1e-07, 
                  type = c("vecbyrow", "bylag"), verbose = TRUE)

Arguments

x

time series.

order

order, an integer number.

nseasons

number of seasons, an integer number.

seasonof1st

season of the first observation.

maxiter

max number of iterations.

harmonics

the harmonics to include in the model, vector of non-negative integers.

sintercept

if TRUE include seasonal intercept.

tol

when to stop the iterations.

type

type of parameterisation, currently one of "vecbyrow" or "bylag".

verbose

if TRUE print more details during estimation.

Details

Fits a subset PAR model using trigonometric parameterisation, i.e. Fourier series for the periodic coefficients written in terms of sines and cosines.

If argument type is bylag, the parameters for each lag are parameterised independently from other lags. If sintercept is TRUE, it has its own trigonometric representation.

If argument type is vecbyrow (“Vec operation by row”), the PAR parameters are stacked in a vector with all parameters for the first season, followed by all parameters for the second, and so on. The trigonometric parameterisation for this vector is used. So the fundamental frequency is 1/(nseasons * order). If sintercept is TRUE when type = vecbyrow, then then the intercept for eaach season is put before the PAR parameters and the fundamental frequency becomes 1/(nseasons * (order + 1). Putting together the intercepts and the PAR parameters may not be very useful for parsimonious trigonometric parameterisation, so to have a separate set of coefficients for the intercepts set attribute"merge" of sintercept to FALSE.

Value

an object from class SubsetPM

Author

Georgi N. Boshnakov

Note

This function may change.

Examples

## see examples for class "SubsetPM"