Learn R Programming

tsDyn (version 11.0.4.1)

resVar: Residual variance

Description

Extracts the global and regime-dependent variance of the residuals

Usage

resVar(x, adj=c("OLS", "ML"))

Value

A vector containing:

Total

The residual variance of the full sample

L, (M), H

The residual variance of the lower (L), middle (if two thresholds) (M) and higher (H) regimes

Arguments

x

setar object

adj

Degrees of freedom adjustment for the variance

Author

Matthieu Stigler

Details

The degree of freedom adjustment in the formula for the variance is the number of parameters when adj="OLS" or zero when adj="ML".

References

Non-Linear Time Series: A Dynamical Systems Approach, Tong, H., Oxford: Oxford University Press (1990).

Examples

Run this code
#Lynx model as in Tong (1980, p. 387)
mod.setar <- setar(log10(lynx), mL=7,mH=2, thDelay=1, th=3.116)
summary(mod.setar)
#coefficients are same for lower regime but differ for higer

resVar(mod.setar, adj="ML")
#variance or the residuals is same for lower regime but differ for higer regime and hence for total

#Lynx model as in Tong (1980, p. 405)
mod.setar2 <- setar(log10(lynx), mL=1,mM=7,mH=2, thDelay=1, nthresh=2,th=c(2.373, 3.154))
round(coefficients(mod.setar2),3)

resVar(mod.setar2, adj="ML")


Run the code above in your browser using DataLab