先求lstar模型
> library(tsDyn)
> x<-c(6.4716,6.775,6.8105,6.7011,6.6908,6.6762,6.6229,6.5891,6.5752,6.5564,6.499,6.4845,6.4716,6.4442,6.3867,6.3549,6.3233,6.3482,6.3009,6.3115,6.2919,6.29,6.28,6.34,6.32,6.33,6.34,6.34,6.3,6.28,6.27)
> mod=lstar(x,m=2,d=3,control=list(maxit=3000))
Using maximum autoregressive order for low regime: mL = 2
Using maximum autoregressive order for high regime: mH = 2
Using default threshold variable: thDelay=0
Performing grid search for starting values...
Starting values fixed: gamma = 100 , th = 6.474287 ; SSE = 0.01007664
Grid search selected lower/upper bound gamma (was: 1 100 ]).
Might try to widen bound with arg: 'starting.control=list(gammaInt=c(1,200))'
接着想对它做arch-lm检验,目前的方法是下载vars程序包,里面有一个arch.test(x, lags.single = 16, lags.multi = 5, multivariate.only = TRUE)的函数做检验,但是我试了很多种写法,都无法调用函数,它要求Please provide an object of class 'varest', generated by 'var()', or an object of class 'vec2var' generated by 'vec2var()'.我不知道该怎样生成var()这种形式的量。