|int(*||base_adapt_fn )(struct apop_mcmc_proposal_s *ps, struct apop_mcmc_settings *ms)|
|void(*||base_step_fn )(double const *, struct apop_mcmc_proposal_s *, struct apop_mcmc_settings *)|
Method settings for a model to be put through Bayesian updating.
After calling apop_model_metropolis, this will have the number of accepted proposals.
|int(* apop_mcmc_settings::base_adapt_fn)(struct apop_mcmc_proposal_s *ps, struct apop_mcmc_settings *ms)|
If a apop_mcmc_proposal_s has
adapt_fn, use this. If you don't want an adapt function, set this to a do-nothing function.
|apop_model * apop_mcmc_settings::base_model|
The model you provided with a
p element (which need not sum to one). You do not have to set this: if it is
NULL on input to apop_model_metropolis, I will fill it in.
|void(* apop_mcmc_settings::base_step_fn)(double const *, struct apop_mcmc_proposal_s *, struct apop_mcmc_settings *)|
If an apop_mcmc_proposal_s struct has
step_fn, use this. If you don't want a step function, set this to a do-nothing function.
|size_t * apop_mcmc_settings::block_starts|
For internal use
What percentage of the periods should be ignored as initialization. That is, this is a number between zero and one.
See the apop_model_metropolis documentation for discussion.
'a': One step draws and accepts/rejects all parameters as a unit
'b': draw in blocks: the vector is a block, the matrix is a separate block, the weights are a separate block, and so on through every page of the model parameters. Each block of parameters is drawn and accepted/rejected as a unit.
'1': draw each parameter and accept/reject separately. One MCMC step consists of a set of draws for every parameter.
If outputting a binned PMF, how many segments should it have?
If you have already run MCMC, the last log likelihood in the chain.
|long int apop_mcmc_settings::periods|
For how many steps should the MCMC chain run?
|apop_model * apop_mcmc_settings::pmf|
If you have already run MCMC, I keep a pointer to the model so far here. Use apop_model_metropolis_draw to get one more draw.
The number of proposal sets; see
For internal use.
|apop_mcmc_proposal_s * apop_mcmc_settings::proposals|
The list of proposals. You can probably use the default of adaptive multivariate normals. See the apop_mcmc_proposal_s struct for details.
After calling apop_model_metropolis, this will have the number of rejected proposals.
'1' (the default), start with a first proposal of all 1s. Even when this is a far-from-useful starting point, MCMC typically does a good job of crawling to better spots early in the chain.
The default when this is unset is to start at the
parameters of the apop_model sent in to apop_model_metropolis.
The desired acceptance rate, for use by adaptive proposals. Default: .35