tune
Tune Bayesian nonlinear non-Gaussian state-space model posterior sampler
Since R2024b
Syntax
Description
The Markov chain Monte Carlo (MCMC) method used by the simulate
function
to sample from the posterior distribution requires a carefully specified proposal
distribution. You can use the tune
function to search for an
adequate posterior mode for simulate
, to improve
the proposal distribution, and therefore, the acceptance rate of the proposed posterior
draws.
[
returns optimized proposal distribution parameter mean vector params
,Proposal
] = tune(PriorMdl
,Y
,params0
)params
and scale matrix Proposal
to improve the MCMC sampler used by simulate
.
PriorMdl
is the Bayesian nonlinear non-Gaussian state-space model
that specifies the state-space model structure (likelihood) and prior distribution,
Y
is the data for the likelihood, and params0
is
the vector of initial values for the unknown state-space model parameters Θ in
PriorMdl
.
[
specifies additional options using one or more name-value arguments. For example,
params
,Proposal
] = tune(PriorMdl
,Y
,params0
,Name=Value
)tune(PriorMdl,Y,params0,Hessian="opg",Display="off")
uses the
outer-product of gradients method to compute the Hessian matrix and suppresses the display
of the optimized values.
Examples
Input Arguments
Output Arguments
Tips
Unless you set
Cutoff=0
,tune
resamples particles according to the specified resampling methodResample
. Although resampling particles with high weights improves the results of the SMC, you should also allow the sampler traverse the proposal distribution to obtain novel, high-weight particles. To do this, experiment withCutoff
.Avoid an arbitrary choice of the initial state distribution.
bnlssm
functions generate the initial particles from the specified initial state distribution, which impacts the performance of the nonlinear filter. If the initial state specification is bad enough, importance weights concentrate on a small number of particles in the first SMC iteration, which might produce unreasonable filtering results. This vulnerability of the nonlinear model behavior contrasts with the stability of the Kalman filter for the linear model, in which the initial state distribution usually has little impact on the filter because the prior is washed out as it processes data.
Algorithms
The MCMC sampler requires a carefully specified proposal distribution.
tune
tunes the sampler by performing numerical optimization to search for a posterior mode. A reasonable proposal for the multivariate normal or t distribution is the inverse of the negative Hessian matrix, whichtune
evaluates at the resulting posterior mode.tune
approximates the data likelihood by sequential Monte Carlo (SMC), and it approximates the posterior gradient vector and Hessian matrix by the simulation smoother (simsmooth
).tune
tunes the sampler by numerical optimization.When
tune
tunes the proposal distribution, the optimizer thattune
uses to search for a posterior mode before computing the Hessian matrix depends on your specifications.tune
accommodates missing data by not updating filtered state estimates corresponding to missing observations. In other words, suppose there is a missing observation at period t. Then, the state forecast for period t based on the previous t – 1 observations and filtered state for period t are equivalent.
References
[5] Fernández-Villaverde, Jesús, and Juan F. Rubio-Ramírez. "Estimating Macroeconomic Models: A Likelihood Approach." Review of Economic Studies 70(October 2007): 1059–1087. https://doi.org/10.1111/j.1467-937X.2007.00437.x.
Version History
Introduced in R2024b