SubsetPM-class: Class SubsetPM

SubsetPM-classR Documentation

Class SubsetPM

Description

Class "SubsetPM" - subset PAR models with trigonometric parameterisation.

Objects from the Class

Objects can be created by calls of the form new("SubsetPM", ...) but they are typically created by model fitting functions, see the examples.

Slots

theTS:

"ANY", the time series to which the model is fitted.

period:

"integer", the period.

order:

"integer", the order.

findex:

"function".

harmonics:

"integer", Fourier harmonics to include in the model.

call:

"call", the call used to fit the model.

other:

"namedList".

Methods

coef

signature(object = "SubsetPM"): ...

fitted

signature(object = "SubsetPM"): ...

residuals

signature(object = "SubsetPM"): ...

show

signature(object = "SubsetPM"): ...

vcov

signature(object = "SubsetPM"): ...

See Also

fit_trigPAR_optim

Examples

pcfr4 <- pcts(dataFranses1996)[[4]]
x4 <- as.numeric(window(pcfr4, start = availStart(pcfr4), end = availEnd(pcfr4)))

## without 'harmonics' these models are equivalent
tmpfit  <- fit_trigPAR_optim(x4, 2, 4, tol = 1e-14, verbose = FALSE)
tmpfitL <- fit_trigPAR_optim(x4, 2, 4, tol = 1e-14, type = "bylag", verbose = FALSE)

## for comparison
tmpfitP <- pclsdf(x4, 4, 1:2, sintercept = FALSE)

## with intercept
tmpfitc  <- fit_trigPAR_optim(x4, 2, 4, tol = 1e-14, verbose = FALSE,
    sintercept = TRUE)
tmpfitcn  <- fit_trigPAR_optim(x4, 2, 4, tol = 1e-14, verbose = FALSE,
    sintercept = structure(TRUE, merge = TRUE))
tmpfitLc <- fit_trigPAR_optim(x4, 2, 4, tol = 1e-14, type = "bylag",
    verbose = FALSE, sintercept = TRUE)

coef(tmpfitc, matrix = TRUE)
coef(tmpfitcn, matrix = TRUE)
coef(tmpfitLc, matrix = TRUE)

coef(tmpfitc)
coef(tmpfitcn)
coef(tmpfitLc)

coef(tmpfit)
coef(tmpfitL)

## convert to PAR coefficients:
coef(tmpfitc,  type = "PAR", matrix = TRUE)
coef(tmpfitcn, type = "PAR", matrix = TRUE)
coef(tmpfitLc, type = "PAR", matrix = TRUE)

coef(tmpfitL, type = "PAR", matrix = TRUE)



predict(tmpfitc, n.ahead = 4)
predict(tmpfitcn, n.ahead = 4)

sqrt(diag((vcov(tmpfitL))))
e <- residuals(tmpfitL)
fi <-  fitted(tmpfitL)

GeoBosh/pcts documentation built on Dec. 8, 2023, 9:57 p.m.