R成精系列-R语言与门限自回归模型(TAR)

门限自回归模型(threshold autoregressive model),又称阈模型,简称TAR模型,它是一种非线性模型,门限自回归模型由汤家豪(Tong)1978年提出,用来解决一类非线性题。
--百度百科

作为非线性回归模型,门限回归模型在经济计量分析中的应用越来越广泛。在实际操作层面,门限模型的关键是确定门限变量和受门限变量影响的解释变量组。
在R中有许多包可以进行门限分析:

  • pdR
  • TSA
  • tsDyn
  • TAR
  • BAYSTAR
  • Hansen提供的函数

pdR

pdR包中进行面板门限回归的主函数为

ptm(dep, ind1, ind2, d, bootn, trimn, qn, conf_lev, t, n)

主要参数包括:

  • dep:被解释变量,1列单变量,只能以;
  • d:门限变量,1列单变量;
  • ind1:受门限变量影响的解释变量,多列变量组;
  • ind2不受门限变量影响的解释变量,多列变量组;
  • bootn:Boostrap重复次数,门限数量通过bootn和trimn参数控制,如bootn=10、bootn=c(10,10)以及bootn=c(10,10,10)分别表示单门限、双门限和三门限模型;
  • trimn:数据剪切比例;
  • qn:待检验分位数个数;
  • conf_lev:置信水平,比如0.95;
  • t:时间跨度;
  • n:横截面的个体数。

注意:
depdind1ind2只能以矩阵形式存储,不能以向量形式存储,否者程序会报错。
ptm()函数的运行结果最终保存为list形式,list中元素的个数等于门限数量。

TSA

TSA包中可以通过tar函数进行门限回归:

tar(y, p1, p2, d, is.constant1 = TRUE, is.constant2 = TRUE, transform = "no",
 center = FALSE, standard = FALSE, estimate.thd = TRUE, threshold, 
method = c("MAIC", "CLS")[1], a = 0.05, b = 0.95, order.select = TRUE, print = FALSE)

主要参数包括:

y
time series
p1
AR order of the lower regime
p2
AR order of the upper regime
d
delay parameter
is.constant1
if True, intercept included in the lower regime, otherwise the intercept is fixed at zero
is.constant2
similar to is.constant1 but for the upper regime
transform
available transformations: "no" (i.e. use raw data), "log", "log10" and "sqrt"
center
if set to be True, data are centered before analysis
standard
if set to be True, data are standardized before analysis
estimate.thd
if True, threshold parameter is estimated, otherwise it is fixed at the value supplied by threshold
threshold
known threshold value, only needed to be supplied if estimate.thd is set to be False.
method
"MAIC": estimate the TAR model by minimizing the AIC; "CLS": estimate the TAR model by the method of Conditional Least Squares.
a
lower percent; the threshold is searched over the interval defined by the a100 percentile to the b100 percentile of the time-series variable
b :upper percent
order.select:If method is "MAIC", setting order.select to True will enable the function to further select the AR order in each regime by minimizing AIC
print: if True, the estimated model will be printed

Hansen提供的函数

详见

你可能感兴趣的:(R成精系列-R语言与门限自回归模型(TAR))