Hi all,
I have started the work of rewriting distribution-related functions, beginning by the easiest one (the normal).
Concerning the others, a few points:
1) I discovered that prior_draw.m contains at the bottom a function which draws samples from a gamma. This would solve our copyright problem with gamm_rnd.m, if you confirm to me that you wrote it.
2) In some files, there is code for an inverse gamma of type 2 (represented by integer 6 in Dynare). This distribution is not handled by the preprocessor at this time. Should I add it ? Note that rndprior.m doesn't handle it, while prior_draw.m and draw_prior_density.m do.
3) Just for your information, note that the wikipedia page on the inverse gamma (http://en.wikipedia.org/wiki/Inverse-gamma_distribution) documents a distribution similar to your type-2-inv-gamma (up to a parameter rescaling). I could not find any page on your type-1-inv-gamma (represented by integer 4 in Dynare). This took me some time to understand, until I looked at the headers of lpdfig1.m and lpdfig2.m. Therefore it seems that the definition of what is inverse gamma is not really standardized.
4) There are some factorization opportunities which I would like to take advantage of: * in prior_draw.m: currently does not take advantage of beta_rnd.m (while rndprior.m does) * in draw_prior_density.m: we could use the new PDF functions instead of rewriting the PDF in an inline fashion * factorize code for the two inverse gammas
Best
Sébastien
Salut Sébastien,
I think we wrote gamma_draw(), so you can use this one. But I am not sure that the code is the most efficient...
The parser should handle the inverse-gamma type 2.
For the inverse gammas you may look at something I wrote a couple of years ago:
http://www.cepremap.cnrs.fr/~adjemian/r/dynare/pdf/Distributions.pdf
It's an unfinished document (I have to find the tex source ;-) the definition of the beta is still missing. The informations given by wikipédia are incomplete. The definitions of the inv-gammas are standard (for bayesian statisticians ;-), we follow Zellner (1971) and also Bauwens, Lubrano and Richard (199?).
Best, Stéphane.
Le Monday 04 August 2008 17:03:55 Sébastien Villemot, vous avez écrit :
Hi all,
I have started the work of rewriting distribution-related functions, beginning by the easiest one (the normal).
Concerning the others, a few points:
- I discovered that prior_draw.m contains at the bottom a function
which draws samples from a gamma. This would solve our copyright problem with gamm_rnd.m, if you confirm to me that you wrote it.
- In some files, there is code for an inverse gamma of type 2
(represented by integer 6 in Dynare). This distribution is not handled by the preprocessor at this time. Should I add it ? Note that rndprior.m doesn't handle it, while prior_draw.m and draw_prior_density.m do.
- Just for your information, note that the wikipedia page on the
inverse gamma (http://en.wikipedia.org/wiki/Inverse-gamma_distribution) documents a distribution similar to your type-2-inv-gamma (up to a parameter rescaling). I could not find any page on your type-1-inv-gamma (represented by integer 4 in Dynare). This took me some time to understand, until I looked at the headers of lpdfig1.m and lpdfig2.m. Therefore it seems that the definition of what is inverse gamma is not really standardized.
- There are some factorization opportunities which I would like to
take advantage of:
- in prior_draw.m: currently does not take advantage of beta_rnd.m
(while rndprior.m does)
- in draw_prior_density.m: we could use the new PDF functions instead
of rewriting the PDF in an inline fashion
- factorize code for the two inverse gammas
Best
Sébastien
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
The justification for inverse_gamma type 1, is that traditionaly, one takes inverse_gamma type 2 for the prior of variance. As we are settting priors for standard deviation, it seems more coherent to take inverse_gamma type 1 that is related to the previous one by a square root.
Best
Michel
Stéphane Adjemian wrote:
Salut Sébastien,
I think we wrote gamma_draw(), so you can use this one. But I am not sure that the code is the most efficient...
The parser should handle the inverse-gamma type 2.
For the inverse gammas you may look at something I wrote a couple of years ago:
http://www.cepremap.cnrs.fr/~adjemian/r/dynare/pdf/Distributions.pdf
It's an unfinished document (I have to find the tex source ;-) the definition of the beta is still missing. The informations given by wikipédia are incomplete. The definitions of the inv-gammas are standard (for bayesian statisticians ;-), we follow Zellner (1971) and also Bauwens, Lubrano and Richard (199?).
Best, Stéphane.
Le Monday 04 August 2008 17:03:55 Sébastien Villemot, vous avez écrit :
Hi all,
I have started the work of rewriting distribution-related functions, beginning by the easiest one (the normal).
Concerning the others, a few points:
- I discovered that prior_draw.m contains at the bottom a function
which draws samples from a gamma. This would solve our copyright problem with gamm_rnd.m, if you confirm to me that you wrote it.
- In some files, there is code for an inverse gamma of type 2
(represented by integer 6 in Dynare). This distribution is not handled by the preprocessor at this time. Should I add it ? Note that rndprior.m doesn't handle it, while prior_draw.m and draw_prior_density.m do.
- Just for your information, note that the wikipedia page on the
inverse gamma (http://en.wikipedia.org/wiki/Inverse-gamma_distribution) documents a distribution similar to your type-2-inv-gamma (up to a parameter rescaling). I could not find any page on your type-1-inv-gamma (represented by integer 4 in Dynare). This took me some time to understand, until I looked at the headers of lpdfig1.m and lpdfig2.m. Therefore it seems that the definition of what is inverse gamma is not really standardized.
- There are some factorization opportunities which I would like to
take advantage of:
- in prior_draw.m: currently does not take advantage of beta_rnd.m
(while rndprior.m does)
- in draw_prior_density.m: we could use the new PDF functions instead
of rewriting the PDF in an inline fashion
- factorize code for the two inverse gammas
Best
Sébastien
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Thanks to both of you for your clarifications. The wikipedia article would greatly benefit from your explanations :) Stéphane: I think it could be useful if you put your latex document on distributions in Dynare's documentation directory
I have removed all the distribution-related files which were not under the GPL. I also added support for the inverse gamma of type 2 in the preprocessor (and added some missing code in matlab files). Until now, the keyword "inv_gamma2_pdf" was supported in *.mod files, but it was giving a type 1 inverse gamma...
Two points:
1) It took me some time to figure out that in bayestopt_, p1 and p2 are mean and stddev for some distributions, while it is nu and s for inverse gammas (and p3 and p4 for uniform). Is there a good reason for not precomputing alpha and beta parameters for beta and gamma priors? At the present time, we recompute these alpha and beta parameters several times (actually every time we do a random draw in rndprior.m). By the way this would greatly simplify prior_draw.m, where we do this recomputation in a separate pass.
2) For inverse gamma type 1, there seems to be a bug in prior_bounds.m. It recomputes parameters nu and s in a strange way, while (if my understanding is correct), we have nu = bayestopt_.p2 and s = bayestopt_.p1. Note that, in the same file, the part for inverse gamma type 2 was added by myself.
Best
Sébastien
"Michel Juillard" michel.juillard@ens.fr a écrit :
The justification for inverse_gamma type 1, is that traditionaly, one takes inverse_gamma type 2 for the prior of variance. As we are settting priors for standard deviation, it seems more coherent to take inverse_gamma type 1 that is related to the previous one by a square root.
Best
Michel
Stéphane Adjemian wrote:
Salut Sébastien,
I think we wrote gamma_draw(), so you can use this one. But I am not sure that the code is the most efficient...
The parser should handle the inverse-gamma type 2.
For the inverse gammas you may look at something I wrote a couple of years ago:
http://www.cepremap.cnrs.fr/~adjemian/r/dynare/pdf/Distributions.pdf
It's an unfinished document (I have to find the tex source ;-) the definition of the beta is still missing. The informations given by wikipédia are incomplete. The definitions of the inv-gammas are standard (for bayesian statisticians ;-), we follow Zellner (1971) and also Bauwens, Lubrano and Richard (199?).
Best, Stéphane.
Le Monday 04 August 2008 17:03:55 Sébastien Villemot, vous avez écrit :
Hi all,
I have started the work of rewriting distribution-related functions, beginning by the easiest one (the normal).
Concerning the others, a few points:
- I discovered that prior_draw.m contains at the bottom a function
which draws samples from a gamma. This would solve our copyright problem with gamm_rnd.m, if you confirm to me that you wrote it.
- In some files, there is code for an inverse gamma of type 2
(represented by integer 6 in Dynare). This distribution is not handled by the preprocessor at this time. Should I add it ? Note that rndprior.m doesn't handle it, while prior_draw.m and draw_prior_density.m do.
- Just for your information, note that the wikipedia page on the
inverse gamma (http://en.wikipedia.org/wiki/Inverse-gamma_distribution) documents a distribution similar to your type-2-inv-gamma (up to a parameter rescaling). I could not find any page on your type-1-inv-gamma (represented by integer 4 in Dynare). This took me some time to understand, until I looked at the headers of lpdfig1.m and lpdfig2.m. Therefore it seems that the definition of what is inverse gamma is not really standardized.
- There are some factorization opportunities which I would like to
take advantage of:
- in prior_draw.m: currently does not take advantage of beta_rnd.m
(while rndprior.m does)
- in draw_prior_density.m: we could use the new PDF functions instead
of rewriting the PDF in an inline fashion
- factorize code for the two inverse gammas
Best
Sébastien
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
"Sébastien Villemot" sebastien.villemot@ens.fr a écrit :
- For inverse gamma type 1, there seems to be a bug in
prior_bounds.m. It recomputes parameters nu and s in a strange way, while (if my understanding is correct), we have nu = bayestopt_.p2 and s = bayestopt_.p1. Note that, in the same file, the part for inverse gamma type 2 was added by myself.
Sorry, I figured out it was not a bug, since the formula was correct. I removed it anyway, since it was unnecessary to recompute something which has already been computed in inverse_gamma_specification.m
Sébastien
Hi All
I am encountering
??? Undefined command/function 'filtered_values'. Error in ==> DsgeSmoother at 253: oo_.NewFilteredVariables = QT*filtered_values(data1,ahat,P,T,Z);
I.e. "filtered_values" does not appear anywhere in the system and I am not familiar with that file to start changing it.
Best regards
G.
Hi George, Michel told me last week that he was working on the filtered variables. I guess he forgot to commit the file filtered_values.m. Unfortunatly he is offline this week.
Best, Stéphane.
Stéphane Adjemian Université du Maine, GAINS & CEPREMAP.
Le Thursday 07 August 2008 15:06:27 G. Perendia, vous avez écrit :
Hi All
I am encountering
??? Undefined command/function 'filtered_values'. Error in ==> DsgeSmoother at 253: oo_.NewFilteredVariables = QT*filtered_values(data1,ahat,P,T,Z);
I.e. "filtered_values" does not appear anywhere in the system and I am not familiar with that file to start changing it.
Best regards
G.
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Thanks Stéphane
I noticed that the line did not exist in previous versions of DsgeSmoother and it seems that neither LHS or RHS of the equation are referred elsewhere in the current system, so, it seems like it can be commented out for a time being until we get the missing function.
I will therefore commit a commented out version as a temporary fix.
Best regards
George
----- Original Message ----- From: "Stéphane Adjemian" stephane.adjemian@ens.fr To: "List for Dynare developers" dev@dynare.org Sent: Thursday, August 07, 2008 6:10 PM Subject: Re: [DynareDev] Undefined command-function 'filtered_values'
Hi George, Michel told me last week that he was working on the filtered variables. I guess he forgot to commit the file filtered_values.m. Unfortunatly he is offline this week.
Best, Stéphane.
Stéphane Adjemian Université du Maine, GAINS & CEPREMAP.
Le Thursday 07 August 2008 15:06:27 G. Perendia, vous avez écrit :
Hi All
I am encountering
??? Undefined command/function 'filtered_values'. Error in ==> DsgeSmoother at 253: oo_.NewFilteredVariables = QT*filtered_values(data1,ahat,P,T,Z);
I.e. "filtered_values" does not appear anywhere in the system and I am not familiar with that file to start changing it.
Best regards
G.
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
_______________________________________________ Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Thanks George, it is my mistake and Stéphane had the right explanation.
Best
Michel
G. Perendia wrote:
Thanks Stéphane
I noticed that the line did not exist in previous versions of DsgeSmoother and it seems that neither LHS or RHS of the equation are referred elsewhere in the current system, so, it seems like it can be commented out for a time being until we get the missing function.
I will therefore commit a commented out version as a temporary fix.
Best regards
George
----- Original Message ----- From: "Stéphane Adjemian" stephane.adjemian@ens.fr To: "List for Dynare developers" dev@dynare.org Sent: Thursday, August 07, 2008 6:10 PM Subject: Re: [DynareDev] Undefined command-function 'filtered_values'
Hi George, Michel told me last week that he was working on the filtered variables. I guess he forgot to commit the file filtered_values.m. Unfortunatly he is offline this week.
Best, Stéphane.
Stéphane Adjemian Université du Maine, GAINS & CEPREMAP.
Le Thursday 07 August 2008 15:06:27 G. Perendia, vous avez écrit :
Hi All
I am encountering
??? Undefined command/function 'filtered_values'. Error in ==> DsgeSmoother at 253: oo_.NewFilteredVariables = QT*filtered_values(data1,ahat,P,T,Z);
I.e. "filtered_values" does not appear anywhere in the system and I am not familiar with that file to start changing it.
Best regards
G.
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Hi Stéphane,
you are right on that. Did you get a chance to look about the correct usage of the term "filtered variable"?
Best
Michel
Stéphane Adjemian wrote:
Hi George, Michel told me last week that he was working on the filtered variables. I guess he forgot to commit the file filtered_values.m. Unfortunatly he is offline this week.
Best, Stéphane.
Stéphane Adjemian Université du Maine, GAINS & CEPREMAP.
Le Thursday 07 August 2008 15:06:27 G. Perendia, vous avez écrit :
Hi All
I am encountering
??? Undefined command/function 'filtered_values'. Error in ==> DsgeSmoother at 253: oo_.NewFilteredVariables = QT*filtered_values(data1,ahat,P,T,Z);
I.e. "filtered_values" does not appear anywhere in the system and I am not familiar with that file to start changing it.
Best regards
G.
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Hi Michel,
I am in Tokyo for the Dynare workshop. People seem very interested in Dynare here.
For the filtered variables I think you are right (I was totally wrong about the definition of filtered variables...), but I opened only one of my books last week. So I am not yet totally convinced that there is an agreement on this definition. I will look at the other books friday...
Best, Stéphane.
Le Monday 11 August 2008 22:04:40 Michel Juillard, vous avez écrit :
Hi Stéphane,
you are right on that. Did you get a chance to look about the correct usage of the term "filtered variable"?
Best
Michel
Stéphane Adjemian wrote:
Hi George, Michel told me last week that he was working on the filtered variables. I guess he forgot to commit the file filtered_values.m. Unfortunatly he is offline this week.
Best, Stéphane.
Stéphane Adjemian Université du Maine, GAINS & CEPREMAP.
Le Thursday 07 August 2008 15:06:27 G. Perendia, vous avez écrit :
Hi All
I am encountering
??? Undefined command/function 'filtered_values'. Error in ==> DsgeSmoother at 253: oo_.NewFilteredVariables = QT*filtered_values(data1,ahat,P,T,Z);
I.e. "filtered_values" does not appear anywhere in the system and I am not familiar with that file to start changing it.
Best regards
G.
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Hi Stéphane,
thank you for the good news from Tokyo. I will be back in Paris on Thursday. Let's try to talk over the phone on Friday or over the week-end.
All the best,
Michel
Stéphane Adjemian wrote:
Hi Michel,
I am in Tokyo for the Dynare workshop. People seem very interested in Dynare here.
For the filtered variables I think you are right (I was totally wrong about the definition of filtered variables...), but I opened only one of my books last week. So I am not yet totally convinced that there is an agreement on this definition. I will look at the other books friday...
Best, Stéphane.
Le Monday 11 August 2008 22:04:40 Michel Juillard, vous avez écrit :
Hi Stéphane,
you are right on that. Did you get a chance to look about the correct usage of the term "filtered variable"?
Best
Michel
Stéphane Adjemian wrote:
Hi George, Michel told me last week that he was working on the filtered variables. I guess he forgot to commit the file filtered_values.m. Unfortunatly he is offline this week.
Best, Stéphane.
Stéphane Adjemian Université du Maine, GAINS & CEPREMAP.
Le Thursday 07 August 2008 15:06:27 G. Perendia, vous avez écrit :
Hi All
I am encountering
??? Undefined command/function 'filtered_values'. Error in ==> DsgeSmoother at 253: oo_.NewFilteredVariables = QT*filtered_values(data1,ahat,P,T,Z);
I.e. "filtered_values" does not appear anywhere in the system and I am not familiar with that file to start changing it.
Best regards
G.
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev