SMM.jl

Simulated Method of Moments (SMM) for Julia

A package providing supporting infrastructure and algorithms to perform Simulated Method of Moments.

Features

  • Fully fledged SMM infrastructure to track moments and function evaluations.
  • Supply your own objective function to be optimized.
  • Optimization can be carried out in parallel.
  • Diagnostic tools illustrating the proposal distribution as well as markov chain statistics.
  • Includes a parellel tempering likelihood-free optimizer using MCMC technology and a coordinate descent optimizer.

For some example usage see the Examples page.

Manual Outline

MProb: Minimisation/Maximisation Problems

  • A core object of this library is the MProb type, specifying an optimisation problem.
SMM.MProbType

Minimisation Problem: MProb

A moment minimsation problem is defined by an objective function that depends on a vector of unknown parameters params_to_sample, and a set of datamoments moments. The key idea here is the one of simulated method of moments, where we use params_to_sample to simulate a model, some moments of which will be compared to moments from the data.

Fields:

  • initial_value: initial parameter value as a dict
  • params_to_sample: OrderedDict with lower and upper bounds
  • objfunc: objective function
  • objfunc_opts: options passed to the objective function, e.g. printlevel
  • moments: a dictionary or dataframe of data moments to track

Example:

pb    = Dict(p1" => [0.2,-2,2] , "p2" => [-0.2,-2,2] )
moms  = DataFrame(name=["mu2","mu1"],value=[0.0,0.0],weight=rand(2))
m     = MProb() 
addSampledParam!(m,pb) 
addMoment!(m,moms) 
SMM.addEvalFunc!(m,SMM.objfunc_norm)
source
SMM.addMoment!Method
addMoment!(m::MProb,name::Symbol,value,weight)

Add Moments to an MProb. Adds a single moment to the mprob.

name: the name of the moment as a Symbol value: value of the moment weight: weight in the objective function

source
SMM.addParam!Method

Add initial parameter values to an MProb minimisation problem.

Arguments:

  • p: A Dict with (String,Number) pairs
source
SMM.addSampledParam!Function

Add parameters to be sampled to an MProb.

d: a Dict with a triple (init,lb,ub) as value for each key.

source
SMM.evaluateObjectiveMethod
evaluateObjective(m::MProb,p::Union{Dict,OrderedDict};noseed=false)

Evaluate the objective function of an MProb at a given parameter vector p. Set noseed to true if you want to generate new random draws for shocks in the objective function (necessary for estimation of standard errors in get_stdErrors, for example)

source
SMM.mapto_01Method
mapto_01(p::OrderedDict,lb::Vector{Float64},ub::Vector{Float64})

map param to [0,1]

source
SMM.mapto_abMethod
mapto_ab(p::Vector{Float64},lb::Vector{Float64},ub::Vector{Float64})

map param from [0,1] to [a,b]

source