Difference in similar specified Minnesota Priors

Questions and discussions on Vector Autoregressions
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Difference in similar specified Minnesota Priors

Unread post by Jules89 »

Dear Tom,

I compared two ways of constructing a Minnesota Prior, which are similar and therefore should yield the same results.
The first one is done by the @BVARBuildPriorMN procedure. The code is:

Code: Select all

open data haversample.rat
cal(q) 1959
data(format=rats) 1959:1 2006:4 ftb3 gdph ih cbhm

set loggdp = log(gdph)
set loginv = log(ih)
set logc   = log(cbhm)


*** VAR Setup and Storage Matrices

compute lags=2			;*Number of lags
compute nstep=40		;*Number of response steps
compute nburn=500   	;*Number of burn-in draws
compute ndraws=2500	    ;*Number of keeper draws

compute tight=.1
compute other=.5


system(model=varmodel)
   variables loggdp loginv logc ftb3
   lags 1 to lags
   det constant
end(system)

estimate(ols,sigma)  ;*initial set of estimations
impulse(model=varmodel,steps=nstep,results=impulses)  

@BVARBuildPriorMN(model=varmodel,tight=tight,other=other,decay=1) HBPRIORS HPRIORS
@BVARFinishPrior hbpriors hpriors bprior hprior
And the second is done by

Code: Select all


open data haversample.rat
cal(q) 1959
data(format=rats) 1959:1 2006:4 ftb3 gdph ih cbhm

set loggdp = log(gdph)
set loginv = log(ih)
set logc   = log(cbhm)


*** VAR Setup and Storage Matrices

compute lags=2			;*Number of lags
compute nstep=40		;*Number of response steps
compute nburn=500   	;*Number of burn-in draws
compute ndraws=2500	    ;*Number of keeper draws

compute tight=.1
compute other=.5


system(model=varmodel)
   variables loggdp loginv logc ftb3
   lags 1 to lags
   det constant
end(system)

estimate(ols,sigma)  ;*initial set of estimations
impulse(model=varmodel,steps=nstep,results=impulses) 

compute ncoef=lags*nvar+1  ;* Number of coefficients per equation
dec rect minnmean(ncoef,nvar) minnprec(ncoef,nvar)

do i=1,nvar
   do j=1,nvar
      do l=1,lags
         compute minnmean((j-1)*lags+l,i)=(i==j.and.l==1)
         compute minnprec((j-1)*lags+l,i)=(olssee(j)/olssee(i))*%if(i==j,l^(-1)/tight,l^(-1)/(other*tight))
      end do l
   end do j
   compute minnmean(ncoef,i)=0.0,minnprec(ncoef,i)=0.0
end do i

display minnmean
display minnprec

ewise minnprec(i,j)=minnprec(i,j)^2
compute hprior=%diag(%vec(minnprec))
compute bprior=minnmean
display hprior

Both lead to different Priors for the precision. Why is this the case?

Thank you in advance

Jules
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Difference in similar specified Minnesota Priors

Unread post by TomDoan »

There's a slight difference with the scaling factors. The procedure uses the standard errors for univariate autoregressions (which is what is used in the RATS ESTIMATE instruction), while the code excerpt uses standard errors from an OLS autoregression (which is easier to program). The differences tend to be fairly minor.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Difference in similar specified Minnesota Priors

Unread post by Jules89 »

Thank you for you reply.
As far as I understand the first code uses the square root of diagonal elements of the residual covariance matrix of the estimated VAR, while the procedure estimates an AR(1) and uses the square root of the residual variance?

I have go another question regarding the construction of the precision. Both in the first code as well as in the procedure, when I want to have a decay in the variances of the prior, the precision is constructed such that with increasing lag the inverse of the variance gets smaller.
This is because in the code for the precision (as well as in the procedure) we have %if(i==j,l^(-1)/tight,l^(-1)/(other*tight)), where l stands for the lag.
But this would mean that the variance actually gets larger. Wouldn't then the right way be %if(i==j,l/tight,l/(other*tight))?
Because, as far as I understand the Minnesota Prior correctly, the variance on the first lag should be the largest and the variance on the other lags should get smaller and smaller to zero out the effect of larger lags?

Thank you in advance

Jules
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Difference in similar specified Minnesota Priors

Unread post by TomDoan »

Sorry. You're right. As that's written, minnprec is (initially) the square root of the precision rather than the square root of the standard deviation (the manuals describe the prior in , so it should be l^1, not l^(-1) to get the standard harmonic decay.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Difference in similar specified Minnesota Priors

Unread post by Jules89 »

Thank you very much Tom

Best Jules
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Difference in similar specified Minnesota Priors

Unread post by Jules89 »

Just another thing, wouldn't that mean, that the code for the @BVARBuildPriorMN is wrong when it comes to the decay?

Best Jules
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Difference in similar specified Minnesota Priors

Unread post by TomDoan »

You're correct. The relevant line should read:

compute se=fij*(olssee(i)/olssee(j))*(lag^(-decay))
Post Reply