epoh 发表于 2010-10-15 12:04 
这不是数据的问题
因为package自带的数据lynx,也发生同样问题
library(tsDyn)
不对呢:
你说到:“其实你也可以使用function star
因为star 也是使用Logistic transition function
底下两者结果相同
mod.star <- star(log10(lynx), m=2, d=1, control=list(maxit=3000))
mod.star
summary(mod.star)
mod.lstar <- lstar(log10(lynx), m=2, d=1, control=list(maxit=3000))
mod.lstar”
但我用同样的数据(Y)进行对比,出现不同的结果;如下。
> mod.star <- star(y, m=2, d=1, control=list(maxit=3000))
Using default threshold variable: thDelay=0
Testing linearity... p-Value = 0.4377235
The series is linear. Using linear model instead.
> mod.star
Non linear autoregressive model
AR model
Coefficients:
const phi.1 phi.2
0.001580686 1.213115336 -0.327246860
> mod.lstar <- lstar(y, m=2, d=1, 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 = 40 , th = 0.9588955 ; SSE = 43.58875
Optimization algorithm converged
Optimized values fixed for regime 2 : gamma = 41.8667 , th = 0.9560731
> mod.lstar
Non linear autoregressive model
LSTAR model
Coefficients:
Low regime:
phi1.0 phi1.1 phi1.2
-0.05123484 1.12120401 -0.29997985
High regime:
phi2.0 phi2.1 phi2.2
0.45453226 0.05158612 -0.14314690
Smoothing parameter: gamma = 41.87
Threshold
Variable: Z(t) = + (1) X(t) + (0) X(t-1)
Value: 0.956
>
这可是质的差别呢。
本文来自: 人大经济论坛 S-Plus&R专版 版,详细出处参考:
https://bbs.pinggu.org/forum.php? ... 3&from^^uid=57021