- computation of maximum likelihood or posterior mode (starts around line 347)

- runs MCMC (starts around line 1003)

- computes the posterior distributions of various statistics (starts around line 1038)

- computes smooth values at the last point estimate of the

parameters (maximum likelihood, posterior mode or

posterior mean) (starts around line 1052)

- Computation of the log posterior density (or log likelihood) is done by [[DsgeLikelihood.m]]

- Computation of the smooth values is done by [[DsgeSmoother.m]]

*** Function <<DsgeLikelihood.m>>

- [[m2html:DsgeLiklihood.html][M2HTML link]]

- This function computes the likelihood of the model and if necessary evaluates the priors in order to compute the posterior. The likelihood is computed with the Kalman filter, but the implementation called here keeps only those elements necessary to the computation of the likelihood, for efficiency reasons. A fuller version of the Kalman filter is called by DsgeSmoother.m.

- The main steps are:

- initialization of the structural parameters

- computation of the solution of the linear rational expectation model by [[dynare\_resolve.m]]

- Evaluation of priors if necessary: [[priordens.m]]

- When the multivariate filter encounters a singularity, Dynare switches automatically to the univariate filter.

*** Function <<DsgeSmoother.m>>

- [[m2html:DsgeSmoother.html][M2HTML link]]

- This functions computes the smoother of the model. The smoother is computed by first running the Kalman filter (forward in time), then the smoother (backward in time).

- The main steps are:

- initialization of the structural parameters

- computation of the solution of the linear rational expectation model by dynare_resolve.m

- initialization of the Kalman filter

- call the appropriate Kalman filter/smoother function (The structure of the smoother routines is different from the filter ones, because we are in the middle of the repackaging this code):