雁茗轩 发表于 2012-4-23 23:48 
恩,是,看来我的还是不好做
yan=read.table("d.txt",header=TRUE)
y=yan$CPI
x=yan$do1           # [0.00 1.00 3.81 1.65....10.84 1.40 1.71 1.93]
x1=yan$do1[2:120]   # [1.00 3.81 1.65....10.84 1.40 ]
x2=yan$do1[3:121]   # [3.81 1.65....10.84 1.40 1.71 ]
x3=yan$do1[4:122]   # [1.65....10.84 1.40 1.71 1.93]
mod1=lstar(y,m=3,d=1,thVar=x1,control=list(maxit=3000))
mod1
LSTAR model
Coefficients:
Low regime:
     const1      phi1.1      phi1.2      phi1.3 
0.27269434  0.72507134 -0.03027709  0.14946705 
High regime:
     const2      phi2.1      phi2.2      phi2.3 
-0.11229556 -0.48641219 -0.08182624 -0.21365960 
Smoothing parameter: gamma = 100 
Threshold
Variable: external
Value: -0.04647 
 
###########
mod2=lstar(y,m=3,d=1,thVar=x2,control=list(maxit=3000))
mod2
LSTAR model
Coefficients:
Low regime:
    const1     phi1.1     phi1.2     phi1.3 
0.1246322  0.3213363 -0.2095328  0.1370120 
High regime:
    const2     phi2.1     phi2.2     phi2.3 
0.2047646  0.2967180  0.3461295 -0.3922440 
Smoothing parameter: gamma = 100 
Threshold
Variable: external
Value: 2.993 
 
##########
mod3=lstar(y,m=3,d=1,thVar=x3,control=list(maxit=3000))
mod3
LSTAR model
Coefficients:
Low regime:
     const1      phi1.1      phi1.2      phi1.3 
0.20220828  0.56478303 -0.08529851  0.02761796 
High regime:
     const2      phi2.1      phi2.2      phi2.3 
-0.14253275 -0.70277458  0.07884266  0.03247553 
Smoothing parameter: gamma = 110.5 
Threshold
Variable: external
Value: 4.786 
