楼主: 南冰
96485 299

急:R软件加载程序包tsDyn问题 [推广有奖]

131
雁茗轩 发表于 2011-10-18 23:03:50
epoh 发表于 2010-9-30 10:23
library(tsDyn)
x
前辈您好!我想请教一下您,在STAR模型中做脉冲响应分析是不是用的bootstrap模拟方法呢?我怎么有点看不懂您在讨论中给出来的那个程序,bootstrap方法不是用来求置信区间的吗?可否详细给我说说,谢谢您啦!

132
epoh 发表于 2011-10-19 15:10:56

请先看两篇文献

看完有概念之后我好解释.

第一篇:先了解[TI] & [GI] 之区别

Smooth Transition Autoregressive Models -A Survey of Recent Developments.pdf
page 27/56
  traditional impulse response function [TI]  (38)
page 28/56
  Generalized Impulse Response Function [GI]  (41)

In case of the STAR model, analytic expressions for the conditional
expectations involved in the GI are not available for h > 1.
Stochastic simulation has to be used to obtain estimates of the
impulse response measures. See Koop et al. (1996) for a detailed
description of the relevant techniques.

接着再看第二篇的详细步骤:

Impulse response analysis in nonlinear multivariate models.pdf
Gary Koop , M. Hashem Pesaran, Simon M. Potter
5. Monte Carlo techniques for computation of GI
   page 17-19/29

133
lintao2006 发表于 2011-10-19 21:44:48
epoh 发表于 2010-9-30 10:23
library(tsDyn)
x
epoch你好,请问R有实现LSTVAR的软件包吗?

134
epoh 发表于 2011-10-20 20:00:51

请先参考底下两个函数

function TVAR()

   Multivariate Treshold Autoregressive model

function TVECM()

   Treshold Vector Error Correction model (VECM)

135
epoh 发表于 2011-10-25 19:24:06

to:雁茗轩

请务必参考page 17-18/29

Monte Carlo techniques for computation of GI step1-7

同时执行79楼程序,才容易理解.

##########
N=60       #the maximum horizon
R=1000     #the number of replications
noh:112    #no. of histories
1. Pick a history and shock, W(t-1),v(t),by some combination of..
2. For a given horizon N, randomly sample (N + 1)x R values
   of the (Kdimensional)innovation
   #generate standardized shocks from lstar model
    st_shock_idx=sample(seq(1:length(std_res)),R*(N+1),replace = TRUE)   
    length(st_shock_idx)
    st_shock=matrix(std_res[st_shock_idx],R,N+1)
    dim(st_shock)  # 1000 x 61
    shockz=st_shock*sd_res
3. Use the first N random shocks (obtained under step 2) to
   compute the realization.....
4. Use the same draw of N random shocks plus one additional
   draw of the random shock to produce a realization...
5. Repeat steps 3 and 4 R times and form the averages...
   ###
   for(i in 1:noh){
   hist=hist_m[i,];
   # benchmark profile   
   .....
   .....
   ######compute "new" histories
   histv=cbind(1,y,histv[,2],y,histv[,2])
   realvb[k]=mean(histv[,4]);
   }  #end k shock profile
6. Take the difference between the two averages to form a
   Monte Carlo estimate of the GI,
   GI[i,]=realvb-realzb;
   }# end i numbers of histories

136
雁茗轩 发表于 2011-10-25 22:38:17
epoh 发表于 2011-10-25 19:24
to:雁茗轩 请务必参考page 17-18/29Monte Carlo techniques for computation of GI step1-7同时执行79楼程序 ...
太感谢您了,我会尽快看完再请教您,谢谢!

137
雁茗轩 发表于 2011-11-9 13:06:54
epoh 发表于 2011-10-25 19:24
to:雁茗轩 请务必参考page 17-18/29Monte Carlo techniques for computation of GI step1-7同时执行79楼程序 ...
epoh老师您好,我想请问一下您,在R软件中估计出STAR模型的各个参数之后,怎么能得到线性部分的系数的标准差呢?谢谢您了!

138
雁茗轩 发表于 2011-11-9 13:06:54
epoh 发表于 2011-10-25 19:24
to:雁茗轩 请务必参考page 17-18/29Monte Carlo techniques for computation of GI step1-7同时执行79楼程序 ...
epoh老师您好,我想请问一下您,在R软件中估计出STAR模型的各个参数之后,怎么能得到线性部分的系数的标准差呢?谢谢您了!

139
epoh 发表于 2011-11-9 13:11:34
73楼

140
toletu 发表于 2012-3-13 09:14:57
我想请问下thDelay 到底是什么意思呢?

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-17 06:20