setar.sim(tsDyn)
setar.sim()所属R语言包:tsDyn
Simulation and bootstrap of Threshold Autoregressive model
门限自回归模型的模拟和自举
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Simulate or bootstrap a Threshold VAR
模拟或启动阈值VAR
用法----------Usage----------
setar.sim(data,B, setarObject, n=200, lag=1, trend=TRUE, nthresh=0, thDelay=0, Thresh, type=c("boot", "simul", "check"), starting=NULL, rand.gen = rnorm, innov = rand.gen(n, ...),...)
参数----------Arguments----------
参数:data
univariate time series
单变量时间序列
参数:B
vector of coefficients to simulate
系数向量来模拟
参数:setarObject
Object of class linear or setar to be bootstrapped
对象的自举类线性或SETAR
参数:n
Number of observations to create when type="simul"
创建时的观测值的数量=“模拟器上”
参数:Thresh
The threshold value(s). Vector of length nthresh
的阈值的值(s)。向量的长度nthresh的
参数:nthresh
number of threshold (see details)
阈值(见详情)
参数:lag
Number of lags to include in each regime
包括在每一个政权的滞后阶数
参数:type
Whether a bootstrap or simulation is to employ. See details
无论是采用自举或模拟。查看详细资料
参数:trend
If a trend should be included in the model
如果这一趋势应包含在模型中
参数:thDelay
'time delay' for the threshold variable (as multiple of embedding time delay d).
“时间延迟”的阈值变量(为多个嵌入时间延迟d)。
参数:starting
Starting values when a simulation with given parameter matrix is made
开始时,给定的参数矩阵的模拟值
参数:rand.gen
optional: a function to generate the innovations.
可选:一个函数来生成的创新。
参数:innov
an optional times series of innovations. If not provided, rand.gen is used.
一个可选的一系列的创新。如果没有提供,rand.gen使用。
参数:...
additional arguments for rand.gen. Most usefully, the standard deviation of the innovations generated by rnorm can be specified by sd.
额外参数rand.gen。最有效的标准偏差所产生的rnorm可以指定sd的创新。
Details
详细信息----------Details----------
This function offers the possibility to generate series following a TAR from two approaches: bootstrap or simulation. When the data is given, one can use a simple residual bootstrap or simulate a series from the parameter matrix and with normal distributed residuals (with variance pre-specified). The choice "check" is just there to check the function: one should obtain the same values as the given values. Please report if different. When the parameter matrix is given, there is only the possibility to simulate series. The starting values (of length equal to the number of lags) can be given. The user should take care for the choice of the starting values and parameters values, since it is not sure that the simulated values will cross the threshold even once.
此功能提供了可能产生以下两种方法:引导或模拟一个TAR系列。当给出的数据是,人们可以使用一个简单的剩余引导或模拟一系列从参数矩阵与正态分布残差(与方差预先指定)。选择“检查”就在那里检查功能:一个人应该得到相同的值给定值。如果不同,请报告。当给定的参数矩阵,只有模拟系列的可能性。可以给出的初始值(长度相等的滞后阶数)。用户应采取照顾的起始值和参数值的选择,因为它是不知道的模拟值将跨越阈值即使一次。
值----------Value----------
a list with the simulated/bootstraped data and the parameter matrix used.
与模拟/ bootstraped的数据和使用的参数矩阵的列表。
(作者)----------Author(s)----------
Matthieu Stigler
参见----------See Also----------
SETAR to estimate a SETAR, arima.sim to simulate an ARMA.
SETAR估计SETAR,arima.sim来模拟一个ARMA。
实例----------Examples----------
##Simulation of a TAR with 1 threshold[1阈值模拟TAR]
sim<-setar.sim(B=c(2.9,-0.4,-0.1,-1.5, 0.2,0.3),lag=2, type="simul", nthresh=1, Thresh=2, starting=c(2.8,2.2))$serie
mean(ifelse(sim>2,1,0)) #approximation of values over the threshold[近似的值,超过阈值]
#check the result[检查结果]
selectSETAR(sim, m=2)
##Bootstrap a TAR with two threshold (three regimes)[引导TAR有两个阈值(三个政权)]
sun<-(sqrt(sunspot.year+1)-1)*2
setar.sim(data=sun,nthresh=2,n=500, type="boot", Thresh=c(6,9))$serie
##Check the bootstrap[#查看引导]
cbind(setar.sim(data=sun,nthresh=2,n=500, type="check", Thresh=c(6,9))$serie,sun)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|