1.6.1. The properties

log_post_kern

mdd/log_post_kern is a property.

theta_draws

mdd/theta_draws is a property.

lb

mdd/lb is a property.

ub

mdd/ub is a property.

maximization

mdd/maximization is a property.

H

Hessian used in the calculation of the laplace approximation. If not provided, finite differences will be used

subset

mdd/subset is a property.

thecoef

mdd/thecoef is a property.

1.6.2. The methods

bridge

BRIDGE Computes the log marginal data density using the “bridge” approximation by [Meng and Wong, 1996].

log_mdd=BRIDGE(obj)

log_mdd=BRIDGE(obj,fix_point)

log_mdd=BRIDGE(obj,fix_point,opts)

Args:

  • obj [mdd]: Marginal Data Density object

  • fix_point [{true}|false|empty]: if true, optimization is done using a fix point algorithm. Else, an iterative strategy is used.

  • opts [empty|struct]: options see help for mdd.global_options

Returns:

:

  • log_mdd [numeric]: log marginal data density

  • extras [struct]: history of log MDD and convergences at each iteration

See also

mdd.laplace, mdd.mhm, mdd.is, mdd.ris, mdd.cj, mdd.mueller, mdd.laplace_mcmc, mdd.swz, mdd.global_options

cj

CJ Computes the log marginal data density using the [Chib and Jeliazkov, 2001] approximation

log_mdd=CJ(obj)

log_mdd=CJ(obj,[],opts)

Args:

  • obj [mdd]: Marginal Data Density object

  • opts [empty|struct]: options see help for mdd.global_options

Returns:

:

  • log_mdd [numeric]: log marginal data density

See also

mdd.laplace, mdd.mhm, mdd.is, mdd.ris, mdd.mueller, mdd.bridge, mdd.laplace_mcmc, mdd.swz, mdd.global_options

global_options

GLOBAL_OPTIONS : generic options for the control of computations for Marginal Data Density calculations. Key options include

  • center_at_mean [{false}|true]: if true, in the calculation of moments, the covariance is centered at the mean, otherwise it is centered at the mode.

  • L [{500}|empty|integer]: number of extra draws

  • debug [{false}|true]: displays certain messages for debugging purposes (algorithm specific)

  • draws_are_iid [{false}|true]:

  • mdd_bridge_TolFun [{sqrt(eps)}|positive scalar]: convergence tolerance for the bridge sampler’s fixed-point loop.

  • mdd_bridge_maxiter [{1000}|positive integer]: maximum number of iterations for the bridge sampler’s fixed-point loop.

See also

mdd.laplace, mdd.mhm, mdd.is, mdd.ris, mdd.cj, mdd.mueller, mdd.bridge, mdd.laplace_mcmc, mdd.swz

is

IS Computes the log marginal data density using the “importance sampling” approximation

log_mdd=IS(obj)

log_mdd=IS(obj,[],opts)

Args:

  • obj [mdd]: Marginal Data Density object

  • opts [empty|struct]: options see help for mdd.global_options

Returns:

:

  • log_mdd [numeric]: log marginal data density

See also

mdd.laplace, mdd.mhm, mdd.ris, mdd.cj, mdd.mueller, mdd.bridge, mdd.laplace_mcmc, mdd.swz, mdd.global_options

laplace

laplace Computes the log marginal data density

log_mdd=laplace(obj)

Args:

  • obj [mdd]: Marginal Data Density object

Returns:

:

  • log_mdd [numeric]: log marginal data density

See also

mdd.mhm, mdd.is, mdd.ris, mdd.cj, mdd.mueller, mdd.bridge, mdd.laplace_mcmc, mdd.swz

laplace_mcmc

laplace_mcmc Computes the log marginal data density using the laplace approximation and a covariance matrix computed from the draws of posterior sampling

log_mdd=laplace_mcmc(obj)

Args:

  • obj [mdd]: Marginal Data Density object

Returns:

:

  • log_mdd [numeric]: log marginal data density

See also

mdd.laplace, mdd.mhm, mdd.is, mdd.ris, mdd.cj, mdd.mueller, mdd.bridge, mdd.swz

laplace_mdd

Computes the log marginal data density using the laplace approximation

log_mdd=laplace_mdd(log_post,Hinv)

Args:

  • log_post [numeric]: log of posterior kernel evaluated at the mode

  • Hinv [matrix]: inverse Hessian (negative of the second derivatives of the log posterior kernel)

Returns:

:

  • log_mdd [numeric]: log marginal data density

mdd

mdd : Constructor for marginal data density objects

Syntax:

obj=mdd(theta_draws,log_post_kern,lb,ub)

obj=mdd(theta_draws,log_post_kern,lb,ub,subset)

obj=mdd(theta_draws,log_post_kern,lb,ub,subset,H)

obj=mdd(theta_draws,log_post_kern,lb,ub,subset,H,maximization)

Inputs

  • theta_draws [char|struct]: sampling drawss => In case of a char, this is the location of the folder containing the draws organized as described below => In case of a structure, the fields are “f” and “x”. Each parameter vector is defined as a structure, which means that theta_draws is a vector of structures. “x” is the parameter vector and “f” is the NEGATIVE of the log posterior kernel evaluated at “x”. In case “f” is instead the log posterior kernel itself, option maximization below has to be set to “true”.

  • lb [empty|vector]: lower bound of the search space. Necessary only for the swz algorithm. Conveniently replaced with the lower bounds of theta_draws if empty.

  • ub [empty|vector]: upper bound of the search space. Necessary only for the swz algorithm. Conveniently replaced with the upper bounds of theta_draws if empty.

  • subset (cell array|{empty}): When not empty, subset is a 1 x 2 cell array in which the first cell contains a vector selecting the columns to retain in each chain and the second column contains the chains retained. Any or both of those cell array containts can be empty. Whenever an entry is empty, all the information available is selected. E.g. subsetting with dropping and trimming mysubs={a:b:c,[1,3,5]}. In this example, the first element selected is the one in position “a” and thereafter every “b” element is selected until we reach element in position “c”. At the same time, we select markov chains 1,3 and 5.

  • H [empty|matrix]: Hessian matrix for the parameters Necessary only for the laplace algorithm. If left empty, finite differences are used.

  • maximization [{false}|true|empty]: Informs the procedure about whether we have a maximization or a minimization problem.

See also

mdd.laplace, mdd.mhm, mdd.is, mdd.ris, mdd.cj, mdd.mueller, mdd.bridge, mdd.laplace_mcmc, mdd.swz

mhm

mhm Computes the log marginal data density using the “modified harmonic mean” approximation by [Geweke, 1999].

log_mdd=mhm(obj)

Args:

  • obj [mdd]: Marginal Data Density object

  • mhm_tau [{(.1:.1:.9)}|vector|scalar|empty]: truncation probabilities

  • opts [empty|struct]: options see help for mdd.global_options

Returns:

  • log_mdd [numeric]: log marginal data density

See also

mdd.laplace, mdd.is, mdd.ris, mdd.cj, mdd.mueller, mdd.bridge, mdd.laplace_mcmc, mdd.swz, mdd.global_options

mueller

MUELLER Computes the log marginal data density using the Ulrich Mueller’s approximation

log_mdd=MUELLER(obj)

log_mdd=MUELLER(obj,[],opts)

Args:

  • obj [mdd]: Marginal Data Density object

  • opts [empty|struct]: options see help for mdd.global_options

Returns:

  • log_mdd [numeric]: log marginal data density

See also

mdd.laplace, mdd.mhm, mdd.is, mdd.ris, mdd.cj, mdd.mueller, mdd.bridge, mdd.laplace_mcmc, mdd.swz, mdd.global_options

normal_weighting

mdd.normal_weighting is a function.

[loglik, v_iF_v, lik] = mdd.normal_weighting(v, det_Sigma, Sigma_i)

ris

RIS Computes the log marginal data density using the “Reciprocal Importance Sampling” approximation as in [Frühwirth-Schnatter, 2006]

log_mdd=RIS(obj)

log_mdd=RIS(obj,[],opts)

Args:

  • obj [mdd]: Marginal Data Density object

  • opts [empty|struct]: options see help for mdd.global_options

Returns:

  • log_mdd [numeric]: log marginal data density

See also

mdd.laplace, mdd.mhm, mdd.is, mdd.cj, mdd.mueller, mdd.bridge, mdd.laplace_mcmc, mdd.swz, mdd.global_options

swz

SWZ Computes the log marginal data density using the [Sims et al., 2008] approximation

log_mdd=SWZ(obj)

log_mdd=SWZ(obj,swz_pvalue)

log_mdd=SWZ(obj,swz_pvalue,opts)

Args:

  • obj [mdd]: Marginal Data Density object

  • swz_pvalue [{90}|empty|scalar]: scalar for the computation of the lower bound. Must be greater than 0 and less than 100

  • opts [empty|struct]: options see help for mdd.global_options

Returns:

:

  • log_mdd [numeric]: log marginal data density

  • extras [struct]: lower bound and corresponding quantile

See also

mdd.laplace, mdd.mhm, mdd.is, mdd.ris, mdd.cj, mdd.mueller, mdd.bridge, mdd.laplace_mcmc, mdd.global_options