Differences between revisions 11 and 12
Revision 11 as of 2011-09-22 15:08:44
Size: 3643
Comment:
Revision 12 as of 2011-09-22 15:35:28
Size: 4639
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
This command allows to specify an initial date and a frequency for the data used by dynare or the data generated by dynare. This command allows to specify an initial date and a frequency for the data used by dynare or the data generated by dynare (this command is noit specific to estimation). There is only one input argument. The frequency is implicit.

=== Syntax examples ===

 * If the initial period is the third quarter of 1950 (quaterly data):
{{{
   set_time(1950Q3)
}}}
 * If the initial period is 1960 (yearly data implicitely assumed):
{{{
   set_time(1960)
}}}
 * If the initial period is the fifth month of 1971 (monthly data):
{{{
   set_time(1971M5)
}}}

=== Behind the scene ===

Instantiate an object from the dynDates class. This object, say '''initial_period''', is stored in '''options_.time'''. If the command '''set_time''' is absent, default initial period is 1 (with yearly frequency). For the preceeding examples, the preprocessor should write in the main matlab file:
{{{
   options_.time.initial_period('1950Q3');
}}}
{{{
   options_.time.initial_period(1960);
}}}
{{{
   options_.time.initial_period('1971M5');
}}}
the default being
{{{
   options_.time.initial_period(1);
}}}

New Estimation Interface

Suggestions for a simplification of the estimation interface in Dynare and breaking very general commands with lots of options in several commands with more targeted scope.

set_time

This command allows to specify an initial date and a frequency for the data used by dynare or the data generated by dynare (this command is noit specific to estimation). There is only one input argument. The frequency is implicit.

Syntax examples

  • If the initial period is the third quarter of 1950 (quaterly data):

   set_time(1950Q3)
  • If the initial period is 1960 (yearly data implicitely assumed):

   set_time(1960)
  • If the initial period is the fifth month of 1971 (monthly data):

   set_time(1971M5)

Behind the scene

Instantiate an object from the dynDates class. This object, say initial_period, is stored in options_.time. If the command set_time is absent, default initial period is 1 (with yearly frequency). For the preceeding examples, the preprocessor should write in the main matlab file:

   options_.time.initial_period('1950Q3');

   options_.time.initial_period(1960);

   options_.time.initial_period('1971M5');

the default being

   options_.time.initial_period(1);

dataset

This command initializes the dataset (an object instantiated by dynSeries). The following options are available:

  • datafile
  • first
  • frequency

estimated_params

Rely on options names rather than argument position in the command line. This new interface would replace estimated_params_bounds and estimated_params_init. The following option names would be necessary

  • For the declaration of the priors
    • shape, name of the prior distribution.

    • mean, mean of the prior distribution.

    • stdev, standard deviation of the prior distribution.

    • variance, variance of the prior distribution.

    • mode, mode of the prior distribution.

    • interval, specification of the prior distribution from the cumulative distribution function defining an interval covering an arbitrary percentage of the prior mass. See below for an example.

    • shift, to shift the domain a distribution. See below for an example (useless if the domain of the distribution is the set of real numbers).

    • domain, specify the domain of distributions with bounded support (uniform and beta).

  • For optimization options
    • boundaries, enforce the optimizer to look for a mode in a specified interval.

    • initial, initial value for the optimizer.

  • For the mcmc options
    • jscale, scale paramemeter for the jumping distribution specific to a parameter.

Syntax examples

The following instructions given as examples are to be used within the estimated_params block.

  • Declaration of a prior for estimated parameter alpha, specified using mean and variance:

     alpha.prior(shape=beta,mean=0.3,variance=0.1^2);
  • Declaration of a prior for estimated parameter alpha, specified using the cumulative distribution function:

     alpha.prior(shape=beta,interval=(0.2,0.4,.9));
  • with this syntax the prior is such that 90% of the prior mass lies between 0.2 and 0.4.
  • Shift the domain of a prior distribution:

     theta.prior(shape=gamma,mode=4,variance=10,shift=+2);
     sigma.prior(shape=gamma,mode=-1,variance=5,shift=-2);
  • In the first case the default domain of the gamma distribution (the set of real positive numbers) is shifted towards infinity in the second case the same distribution is shifted towards minus infinity.
  • Specify the (non default) domain of a prior distribution with bounded support:

     plouf.prior(shape=uniform,domain=(.5,2));
     fuolp.prior(shape=beta,mode=1.5,stdev=.05,domain=(1,2));
  • In the first case the default domain of the gamma distribution (the set of real positive numbers) is shifted towards infinity in the second case the same distribution is shifted towards minus infinity
  • Declaration of the subsamples (must preceed the declaration of the priors):

     alpha.subsamples(name1=1950Q3:1957Q4, name2=1958Q1:1983Q2, name3=1983Q3:2011Q2) 
  • Declaration of alpha's prior over different subsamples (must follow the declaration of the subsamples):

     alpha.name1.prior(shape=normal,mode=0.30,stdev=.01);
     alpha.name2.prior(shape=normal,mode=0.33,stdev=.01);
     alpha.name2.prior(shape=normal,mode=0.40,stdev=.01);

DynareWiki: NewEstimation (last edited 2012-03-26 15:15:22 by HoutanBastani)