Skip to content
Thibaut Lamadon edited this page Jun 30, 2016 · 9 revisions

Overview

One of the main component is the algorithm that determines the next parameter value to compute the model at.

objective function

The objective function is a key element, it represents the problem the use is trying to solve. Taking a list of input parameters, this function will return an overall criteria to be minimized as well as additional infomrmations about the solution. In particular it should return the values of the moments used to form the overall crtiteria.

inputs

  • p a list of parameter values. This contains both the parameter that estimated and all other important parameters like grid sizes, calibrated parameters, etc...
  • msa list of moments to consider

outputs

It should return a list res with the following elements:

  • p : the list of parameters stored back
  • value : the objective value of the function evaluated at p
  • sm : a data.table of the simulated moments with a column name and a column value.
  • infos : a list of additional information that could be relevant.
  • time : time spent in the function evaluation
  • chain : the chain number, p should contain it too.

Example

To see a very basic example see the joint normal objective function.

Algo interface

The algorithm is the code that decides on how to explore the space of the parameters. The packages comes with several implemented algorithms that can be used in parallel, but the user can easily design its own.

inputs

An algo takes the following arguments:

  • chains this is a data.table that contains information about past evaluations. Each row is an evaluations. Important columns of that table are:
    • i the chain id
    • n the evaluation number
    • p.* are parameter values
    • m.* are moment values
    • d.* are additional informations like convergence
    • value the objective value
  • evals a data.frame with the new evaluations
  • opts a list of configuration paramaters for the algorithm
  • pdesc a data.table of the parameters to sample with bounds
  • priv a list that stores the internal state of the list. This will facilitate the interuption and restarting of a given algorithm.

outputs

The return value consist of the private object that can be used to store some internal state and a list of parameter sets to be sent to the worker nodes.

  • a list object with the following fields:
    • ps a list of list of parameters. The mains list should be of the size of the number of chains
    • priv internal state that will be given back at next evaluation
    • evals the new values with accepted/rejected draws

Clone this wiki locally