lower bound and prior_3rd_parameter

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

lower bound and prior_3rd_parameter

Postby ZBCPA » Sat Sep 05, 2015 11:37 am

Dear all,

Could anyone help to explain the difference between lower bound and prior_3rd_parameter in Beyasian estimation?

Thanks in advance.

Huanhuan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: lower bound and prior_3rd_parameter

Postby jpfeifer » Sat Sep 05, 2015 3:37 pm

Lower bound only restricts the parameter during mode-finding. When doing so, it truncates the original distribution. Say you have a normal distribution with mean 0 and variance 1. If you set the lower bound to -1, the standard normal distribution will be truncated to [-1, Infinity). If you would use this in Bayesian estimation, the prior would not integrate to 1, which is the reason, the lower bound is ignored during Bayesian estimation and only active during mode-finding.
prior_3rd_parameter in contrast is used to specify generalized distributions. Take the beta distribution. Its support is always [0,1]. prior_3rd_parameter allows moving the lower bound of the support. Say you set prior_3rd_parameter to -1. In this case, the original beta distribution will be stretched and shifted to the support [-1,1]. The prior will still integrate to 1.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: lower bound and prior_3rd_parameter

Postby ZBCPA » Sun Sep 06, 2015 11:19 am

Dear Johannes Pfeifer,

Many thanks for your reply. It makes me clear.

Best regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: lower bound and prior_3rd_parameter

Postby ZBCPA » Fri Feb 19, 2016 9:09 am

jpfeifer wrote:Lower bound only restricts the parameter during mode-finding. When doing so, it truncates the original distribution. Say you have a normal distribution with mean 0 and variance 1. If you set the lower bound to -1, the standard normal distribution will be truncated to [-1, Infinity). If you would use this in Bayesian estimation, the prior would not integrate to 1, which is the reason, the lower bound is ignored during Bayesian estimation and only active during mode-finding.
prior_3rd_parameter in contrast is used to specify generalized distributions. Take the beta distribution. Its support is always [0,1]. prior_3rd_parameter allows moving the lower bound of the support. Say you set prior_3rd_parameter to -1. In this case, the original beta distribution will be stretched and shifted to the support [-1,1]. The prior will still integrate to 1.



Dear Johannes,
Could I ask two more questions about this?
If I estimate a parameter "alpha", and only when 0.6<alpha<0.9 , the model is determinate. Otherwise it is indeterminacy.
1.Should I use following code to restrict alpha in the determinate region?
Code: Select all
alpha, ,0.6,0.9,gamma_pdf,0.8,0.05,0.6,0.9;


2.If I set prior to cover both indeterminacy and determinacy region, (my code is for determinacy model), like:
Code: Select all
alpha, , , ,gamma_pdf,0.8, 0.05, 0.6,1;


Then does dynare never pick a draw from indeterminacy region [0.9, 1]?Will the prior still integrate to 1?

Thanks in advance.

Kindest regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: lower bound and prior_3rd_parameter

Postby jpfeifer » Sat Feb 20, 2016 7:39 am

Dear Huan,

if you know your parameter is bounded, you should use a prior that restricts it to that range. Using a gamma prior is not advocated because the upper bound is infinity. There is no generalized gamma distribution, so specifying ab upper bound is futile. If you do this as in 1), Dynare will truncate the gamma distribution for mode-finding, but will not use a proper truncated gamma distribution (i.e. will not redistribute the truncated mass). Because of this, your prior will not integrate to 1. Note that this is no problem for estimation, but for model_comparison as the marginal data densities will be wrong.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: lower bound and prior_3rd_parameter

Postby ZBCPA » Thu Feb 25, 2016 1:26 pm

jpfeifer wrote:Dear Huan,

if you know your parameter is bounded, you should use a prior that restricts it to that range. Using a gamma prior is not advocated because the upper bound is infinity. There is no generalized gamma distribution, so specifying ab upper bound is futile. If you do this as in 1), Dynare will truncate the gamma distribution for mode-finding, but will not use a proper truncated gamma distribution (i.e. will not redistribute the truncated mass). Because of this, your prior will not integrate to 1. Note that this is no problem for estimation, but for model_comparison as the marginal data densities will be wrong.


Thank you very much for your reply.

Could I ask further about what you said?

Q1 : If I understand correctly, even if I set not only lower/uppe bound but also the 3rd and 4th parameter to be 0.6 and 0.9 respectively, the support of the gamma distribution only becomes [0.6, infinity) instead of [0.6,0.9]? (this is unlike beta distribution, since both the upper & lower bound of the support of beta distribution can be changed).

Q2: "Prior integrates to 1" is a sufficent and necessary condition for model comparison(while data is same)?

Q3: In my example 1), if I use beta distribution instead of gamma distribution, like
Code: Select all
alpha, ,0.6,0.9,beta_pdf,0.8,0.05,0.6,0.9;
,would the prior
integrate to 1?

Q3: If not, could you please give me some advice how I should set the prior to restict it to a range,like[0.5, 1.5] , and at the same time marginal data densities are computed correctly so that I can make model comparison?

So many questions.....Thank you in advance!

Best regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: lower bound and prior_3rd_parameter

Postby jpfeifer » Fri Feb 26, 2016 9:45 am

Q1: yes, because there is no generalized gamma distribution with an upper bound
Q2: it is necessary, but clearly not sufficient. There are a bunch of regularity conditions involved that need to hold
Q3: yes, that should be correct
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: lower bound and prior_3rd_parameter

Postby ZBCPA » Sun Aug 14, 2016 8:27 am

Dear Johannes,

Could I ask more questions on this topic?

1. As far as I know, 3rd/4th parameters specification should not influence mode-finding results, however, the following 2 priors get completely different mode results (initial value 1.3 , mean1.366, std0.2).
Code: Select all
miu,1.3,1,inf,gamma_pdf,1.366,0.2, 1, inf;

Code: Select all
miu,1.3,1,inf,gamma_pdf,1.366,0.2;


Why does this happen?

2. For some reason, I have to use matlab code instead of dynare to estimate model. The key parameter "miu " should be always >1.
If I truncate like this
Code: Select all
pd=makedist('Gamma','a',1.366^2/0.2^2,'b',0.2^2/1.366);
t=truncate(pd,1,inf);
P1=pdf(t,Theta(1));


would that be correct? It corresponds to truncation of upper and lower bound?

3. If I still confused to set truncated gamma pdf(>1) in matlab code, how about using this way:
I set another parameter "alpha=miu-1" so that when miu>1 , alpha>0. Then I estimate alpha instead of miu using gamma distribution prior without truncation? Does that make sense?

Many many many thanks in advance!
Kind regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: lower bound and prior_3rd_parameter

Postby jpfeifer » Sun Aug 14, 2016 5:55 pm

I can only provide Dynare advice here as I am not working with this type of Matlab implementation.

1. By specifying the 3rd/4th parameters you are setting generalized distributions. Why do you think this should not affect results? Consider a beta distribution. In this case, the mode by construction must be between 0 and 1. Now consider a generalized beta distribution with 3rd/4th parameters 1 and 2. Now the beta distribution will be over the support [1,2] and the mode must be within this interval.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: lower bound and prior_3rd_parameter

Postby ZBCPA » Mon Aug 15, 2016 1:32 am

jpfeifer wrote:I can only provide Dynare advice here as I am not working with this type of Matlab implementation.

1. By specifying the 3rd/4th parameters you are setting generalized distributions. Why do you think this should not affect results? Consider a beta distribution. In this case, the mode by construction must be between 0 and 1. Now consider a generalized beta distribution with 3rd/4th parameters 1 and 2. Now the beta distribution will be over the support [1,2] and the mode must be within this interval.


Many thanks for your reply!

Could I further ask if I need estimate a parameter u which is always >1, but I do not like truncate the prior , so I set
Code: Select all
alpha=u-1
,which is >0. And estimate alpha with not truncated gamma pdf prior. Then use the posterior mean of alpha plus 1 to derive the value of u. Does that make sense?

Kind regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests