Learn R Programming

tsDyn (version 0.7-60)

nlar methods: nlar methods

Description

Generic nlar methods

Usage

## S3 method for class 'nlar':
AIC(object, k=2,\dots)
## S3 method for class 'nlar':
coef(object, \dots)
## S3 method for class 'nlar':
fitted(object, \dots)
## S3 method for class 'nlar':
MAPE(object, \dots)
## S3 method for class 'nlar':
mse(object, \dots)
## S3 method for class 'nlar':
print(x, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'nlar':
residuals(object, \dots)
## S3 method for class 'nlar':
summary(object, \dots)
## S3 method for class 'nlar':
plot(x, ask=interactive(), ...)
## S3 method for class 'nlar':
predict(object, newdata, n.ahead, simulate=FALSE, \dots)
## S3 method for class 'nlar':
toLatex(object, \dots)

Arguments

x, object
fitted nlar object
newdata
data to which to apply the prediction
n.ahead
number of steps ahead at which to predict
simulate
if TRUE, new observations are simulated from underlying Data Generating Process
ask
graphical option. See par
digits
k
numeric, the penalty per parameter to be used; the default k = 2 is the classical AIC
...
further arguments to be passed to and from other methods

Details

[object Object],[object Object],[object Object],[object Object]

See Also

availableModels for listing all currently available models.

Examples

Run this code
x <- log10(lynx)
mod.setar <- setar(x, m=2, thDelay=1, th=3.25)
mod.setar
AIC(mod.setar)
mse(mod.setar)
MAPE(mod.setar)
coef(mod.setar)
summary(mod.setar)

e <- residuals(mod.setar)
e <- e[!is.na(e)]
plot(e)
acf(e)

plot(x)
lines(fitted(mod.setar), lty=2)
legend(x=1910, y=3.9,lty=c(1,2), legend=c("observed","fitted"))

plot(mod.setar)

Run the code above in your browser using DataLab