Page 1 of 1

Graph editting

Posted: Sat Jun 25, 2022 6:00 am
by tyzellar
Dear Tom, Could you please tell me how could I edit the impulse response functions graphs, in order to be able to clearly distinguish between the two IRF functions and the standard errors. Attached to his post you will also find the code and the dataset.

spgraph(vfields=1,hfields=5)
do j=1,1
dofor i=1 2 4 5
compute factor76 = acresp76(j,j)(1)
set respons76 = acresp76(i,j)/factor76
set stde = sqrt(seconda(t,i+(j-1)*nvars))/factor76
set upp = respons76 + band * stde
set low = respons76 - band * stde
graph(header=implabel(i),hlabel="horizon",number=1) 3
# upp 1 nsteps 2
# low 1 nsteps 2
# respons76 1 nsteps 1
end do i

end do j
print / respons76 upp low
compute j=1

set respons76 = resp76(3,j)/factor76
set stde = sqrt(second(t,3+(j-1)*nvars))/factor76
set upp = respons76 + band * stde
set low = respons76 - band * stde
graph(header=implabel(3),hlabel="horizon",number=1) 3
# upp 1 nsteps 2
# low 1 nsteps 2
# respons76 1 nsteps 1
print / respons76 upp low

spgraph(done)

Re: Graph editting

Posted: Sun Jun 26, 2022 9:34 pm
by TomDoan
What was it that you wanted to change. The black line with blue upper and lower is pretty standard.

Re: Graph editting

Posted: Mon Jun 27, 2022 2:36 am
by tyzellar
In the last part of the code, I insert in one graph two impulse response functions and I get this graph, which is not so clear. I run this code and I receive the following graph. I would like to have two different colors for the IRFs and one color for the confidence bands. Thank you in advance!


spgraph(vfields=1,hfields=5)
do j=1,1
dofor i=1 2 4 5
compute factor85 = acresp85(j,j)(1)
compute factor76 = acresp76(j,j)(1)
do n=1,nsteps
compute respons85(n) = acresp85(i,j)(n)/factor85
compute respons76(n) = acresp76(i,j)(n)/factor76
compute stde(n) = sqrt(seconda(n,i+(j-1)*nvars))/factor85
end do n
set upp = respons85 + band * stde
set low = respons85 - band * stde
graph(header=implabel(i),hlabel="horizon",number=1) 4
# upp 1 nsteps 1
# low 1 nsteps 1
# respons85 1 nsteps 1
# respons76 1 nsteps 2
end do i
end do j
compute j=1

set respons85 = resp85(3,j)/factor85
set respons76 = resp76(3,j)/factor76

set stde = sqrt(second(t,3+(j-1)*nvars))/factor76
set upp = respons85 + band * stde
set low = respons85 - band * stde
graph(header=implabel(3),hlabel="horizon",number=1) 4
# upp 1 nsteps 1
# low 1 nsteps 1
# respons85 1 nsteps 1
# respons76 1 nsteps 2
spgraph(done)

Re: Graph editting

Posted: Mon Jun 27, 2022 8:01 am
by TomDoan
You are using 1 (i.e. black) for upp, low and respons85, while 2 (i.e. blue) for respons76. I would think that using respons85 and respons76 should be something different from each other and from upp and low.

graph(header=implabel(3),hlabel="horizon",number=1) 4
# upp 1 nsteps 1
# low 1 nsteps 1
# respons85 1 nsteps 1
# respons76 1 nsteps 2

Re: Graph editting

Posted: Mon Jun 27, 2022 8:40 am
by tyzellar
You are totally right. Thank you very much. I really appreciate your help!