用你讲的例子,我有几问题请教:
>library(tsDyn)
> data=(lynx)
> mod=lstar(log10(lynx), m=2, mTh=c(0,1), control=list(maxit=3000))
> phi1=mod$model.specific$coefficients[1:3]
> phi2=mod$model.specific$coefficients[4:6]
> gamma=mod$model.specific$coefficients[7]
> th=mod$model.specific$coefficients[8]
> z=mod$model.specific$thVar
> G=function(y,g,th) plogis(y, th, 1/g)
> tf=G(z,gamma,th)
> plot(z,tf)
> mod
> summary(mod)
Non linear autoregressive model
LSTAR model
Coefficients:
Low regime:
    const1     phi1.1     phi1.2 
0.4891014  1.2465399 -0.3664328 
High regime:
    const2     phi2.1     phi2.2 
-1.0240758  0.4232669 -0.2546088 
Smoothing parameter: gamma = 11.15 
Threshold
Variable: Z(t) = + (0) X(t) + (1) X(t-1)
Value: 3.339 
Residuals:
      Min        1Q    Median        3Q       Max 
-0.594820 -0.107360  0.014309  0.111098  0.510342 
Fit:
residuals variance = 0.03805,  AIC = -357, MAPE = 5.58%
Coefficient(s):
        Estimate  Std. Error  t value  Pr(>|z|)    
const1  0.489101    0.204914   2.3869 0.0169929 *  
phi1.1  1.246540    0.067871  18.3663 < 2.2e-16 ***
phi1.2 -0.366433    0.104301  -3.5132 0.0004427 ***
const2 -1.024076    2.430066  -0.4214 0.6734492    
phi2.1  0.423267    0.172146   2.4588 0.0139415 *  
phi2.2 -0.254609    0.585416  -0.4349 0.6636207    
gamma  11.153834   10.004728   1.1149 0.2649120    
th      3.339199    0.092748  36.0030 < 2.2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
Non-linearity test of full-order LSTAR model against full-order AR model
F = 12.446 ; p-value = 1.3815e-05 
Threshold 
Variable: Z(t) = + (0) X(t) + (1) X(t-1)
       在结果中,有不显著的系数:phi2.2 (其P值   0.6636207);
       如何去掉这个不显著的phi2.2呢?一直被这个问题纠结!
 
另外
我在用R包中自带的数据进行门限回归学习时;发现有些问题也要向请教。
> library(TSA)
> data(prey.eq)
> prey.tar.1=tar(y=log(prey.eq),p1=4,p2=4,d=3,a=.1,b=.9,print=TRUE)
time series included in this analysis is:  log(prey.eq) 
SETAR(2, 1 , 4 ) model delay = 3 
estimated threshold =  4.661  from a Minimum AIC  fit with thresholds 
searched from the  17  percentile to the   81  percentile of all data.
The estimated threshold is the  56.6  percentile of
all data.
lower regime: 
Residual Standard Error=0.2341
R-Square=0.9978
F-statistic (df=2, 28)=6355.76
p-value=0
                       Estimate Std.Err t-value Pr(>|t|)
intercept-log(prey.eq)   0.2621  0.3156  0.8305   0.4133
lag1-log(prey.eq)        1.0175  0.0704 14.4455   0.0000
(unbiased) RMS 
0.05479 
with no of data falling in the regime being 
log(prey.eq) 30 
(max. likelihood) RMS for each series (denominator=sample size in the regime) 
log(prey.eq) 0.05114 
upper regime: 
Residual Standard Error=0.2676
R-Square=0.9971
F-statistic (df=5, 18)=1253.556
p-value=0
                       Estimate Std.Err t-value Pr(>|t|)
intercept-log(prey.eq)   4.1986  1.2841  3.2697   0.0043
lag1-log(prey.eq)        0.7081  0.2023  3.5005   0.0026
lag2-log(prey.eq)       -0.3009  0.3118 -0.9648   0.3474
lag3-log(prey.eq)        0.2788  0.4063  0.6861   0.5014
lag4-log(prey.eq)       -0.6113  0.2726 -2.2427   0.0377
(unbiased) RMS 
0.07158 
with no of data falling in the regime being 
23 
(max. likelihood) RMS for each series (denominator=sample size in the regime)
0.05602 
Nominal AIC is  10.92 
      我的问题是,在高区中的滞后2,3项的回归系数在一定的显著水平下,P值不算好。那么我肯定要在滞后2,3中进行选择最好的。比如,我首先选择lag3-log的系数为零,进行回归,再来看结果。。。。。。
    请问:
    1、在门限回归中要不要对各区的系数进行显著性或不显著性判定(用其P值)。
    2、如果应当这样作的话,那么我们又如何来限制不显著的系数为零呢?
   请就这个结果和prey.tar.1=tar(y=log(prey.eq),p1=4,p2=4,d=3,a=.1,b=.9,print=TRUE)语句邦助修改。谢谢!
  3、另外我试了一种限制的办法,也是不行的:     
     >prey.tar.1=tar(y=log(prey.eq),p1=4,p2=4,fixed=c(NA,Na,0,Na,NA),d=3,a=.1,b=.9,print=TRUE)
           
     错误于tar(y = log(prey.eq), p1 = 4, p2 = 4, fixed = c(NA,Na,0,Na,NA),  : 
           参数((fixed = c(NA,Na,0,Na,NA))) 没有用。
二类问题是同样的。
 
谢谢!