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)
Run the code above in your browser using DataLab