Description Usage Arguments Value
Given an input negative log-likelihood and temperature, do MCMC sampling of the parameter vector. Let eta be the value of the negative log-likelihood. The function that is sampled is exp(-eta/temp), where temp is the temperature; that is, the likelihood^(1/temp) is sampled. The proposal is made using an independent normal draw for each variable in the parameter vector, theta, with the standard deviation of the proposal distribution set by the scalar parameter prop_scale (the same scale is used for all variables).
The output is a list with starting and sampling information ,and includes the following named elements:
theta0
The initial value of the parameter vector
eta0
The initial value of the negative log-likelihood
temp
The temperature
prop_scale
The scale (standard deviation) for the normal proposal distribution
theta_best
The best parameter vector found (lowest negative log-likelihood)
eta_best
The best (lowest) negative log-likelihood encountered
accept_vect
A boolean vector indicating which samples were accepted
eta_vect
A vector of negative log-likelihood values (for kept samples)
eta_vect
A matrix of sampled parameter vectors, size num_samp by length(theta)
1 | yada_sample_mcmc(neg_log_lik, theta0, num_samp, temp, prop_scale, ...)
|
neg_log_lik |
The function for the negative log-likelihood |
theta0 |
The initial value of the parameter vector |
num_samp |
The number of samples to make |
temp |
The temperature |
prop_scale |
A scalar value for the standard deviation of the proposal distribution |
... |
Variables required by neg_log_lik |
A list containing starting and sampling information (see description)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.