Page 1 of 1

Confidence Interval of Matheson-Stavrev EL (2013)

Posted: Thu Jul 06, 2017 1:06 am
by bok1234
Dear Mr.Doan,

I thank you again for coding of Matheson-Stavrev EL (2013).
Let me ask some more about this.
I want to draw '+/- one standard confidence intervals' for theta, kappa, and gamma.
For example, the Kalman filter results in "Inflation Targeting: a Victim of Its Own Success? (Christian Gillitzer and John Simon, Reserve Bank of Australia, 2015)" includes those estimates with confidence intevals. To do this job, do I need some kind of procedure like montevar.src, or just add some strings in ekfexample.rpf?

Re: Confidence Interval of Matheson-Stavrev EL (2013)

Posted: Thu Jul 06, 2017 3:40 am
by TomDoan
I don't see anything in that paper that describes the source of the confidence intervals. For a state-space model, that requires Gibbs sampling and is much more complicated than simply draws from the posterior as in montevar. I'm assuming that without any further information, they're just looking at the Kalman smoothed estimates of the standard deviations and converting them into confidence bands (truncated to the constraint).

Re: Confidence Interval of Matheson-Stavrev EL (2013)

Posted: Thu Jul 06, 2017 4:30 am
by bok1234
Yes. I just want to draw that kind of C.I. in estimates of theta, gamma, and kappa.
Please see pp.10~11. Weird thing is the widths of confidence intervals is variable - for example, the width of C.I. of theta (p.10) seems to get smaller around 1973, and larger before and after that year. Anyway, how could I add this C.I. to your 3 estimates? Some codes in User Guide as below could be a hint?

dlm(a=1.0,c=1.0,sv=15099.0,sw=1469.1,y=nile,presample=diffuse,$
type=smooth) / xstates vstates
set a = %scalar(xstates)
set p = %scalar(vstates)
set lower = a+sqrt(p)*%invnormal(.05)
set upper = a+sqrt(p)*%invnormal(.95)
graph(footer=$
"Figure 1. Smoothed state and 90% confidence intervals") 4
# nile
# a
# lower / 3
# upper / 3

Re: Confidence Interval of Matheson-Stavrev EL (2013)

Posted: Thu Jul 06, 2017 4:59 am
by TomDoan
I'm assuming they're doing effectively what's shown in that example. Kalman smoothed estimates will always have wider confidence intervals near the beginning and end of the sample. Where they are narrowest will depend upon the complete model.

Re: Confidence Interval of Matheson-Stavrev EL (2013)

Posted: Thu Jul 13, 2017 12:57 am
by bok1234
Dear Mr. Doan,
I added ‘confidence interval’ code lines to your program. Please check 3 state varibles’ 95% Confidence Interval codes at the attached RATS program and the output (pdf). I just want to know whether these are right coding and output.

Re: Confidence Interval of Matheson-Stavrev EL (2013)

Posted: Thu Jul 13, 2017 2:43 pm
by TomDoan
That looks correct. Note that that's filtered, not smoothed.

Re: Confidence Interval of Matheson-Stavrev EL (2013)

Posted: Thu Jul 13, 2017 7:21 pm
by bok1234
Right.smoothed ones seem to be more beautiful.
Thank you.