3
$\begingroup$

I have two questions on how to produce impulse responses using R

(1) Impulse responses to a negative shock in the independent variable (money supply)

(2) Impulse responses at 2 standard deviations

The code I used to generate the impulse responses to a positive shock at 1 standard deviation is the following:

m1 <- read.csv("m1.csv", header=T)

m1

varm1 <- VAR(m1, p=8, type="cons")

irfm1 <- irf(varm1, impulse="m1", response= c("gdp"), boot = FALSE)

plot(irfm1)

irfm1
$\endgroup$
1
$\begingroup$

Here is a simple example that should work:

data("Canada")
var.2c=VAR(Canada,p=2,type="const")
irf.rw.e=irf(var.2c,impulse="rw",response=c("e"))
n=length(irf.rw.e$irf$rw)
for(i in 1:n){irf.rw.e$irf$rw[i]=irf.rw.e$irf$rw[i]*2.0} 
plot(irf.rw.e)

Source

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.