Learn R Programming

bbemkr (version 1.1)

bbeMCMCrecording: MCMC iterations

Description

Select the final bandwidths of the regressors and the variance parameter of the error density

Usage

bbeMCMCrecording(data_x, data_y, x, costpara, num_batch = 50, 
                 M = 10000, step = 20, sizep = 1.2)

Arguments

data_x
Regressors
data_y
Response variable
x
Retained log bandwidths of the regressors, after the warmup or burnin period
costpara
Retained cost value, after the warmup period
num_batch
Number of batch samples
M
Number of iterations
step
Recording value at a specific step, in order to achieve i.i.d. samples and and eliminate or reduce correlation
sizep
Tuning parameter of the bandwidths

Value

  • accept_raterecordingAcceptance rate of the random-walk Metropolis algorithm
  • sum_hSelected parameters in an order of bandwidths of the regressors, variance parameter of the error density, likelihood and cost values
  • std_hStandard deviation of the selected parameters
  • batch_hStandard deviation of the selected parameters from different draws (equal to num_batch)
  • total_sdTotal standard deviation of the selected parameters
  • sifSimulation inefficient factor. The small it is, the better the method is in general
  • R2R square value for determining the goodness of fit
  • data_postGibbs output useful for calculating the Chib's (1995) log marginal density
  • logmarginalNRNewton-Raftery log marginal density
  • loglikelihoodsLog likelihood for the Chib's (1995) log marginal density
  • logpriorLog prior for the Chib's (1995) log marginal density
  • logdensityLog posterior density calculated from the Gibbs output
  • logmarginalChibChib's (1995) log marginal density

Details

Similar to the warmup period, it determines the optimal bandwidths for the regressors and the variance of the error density for finite sample size. It also calculates the SIF value, R square and log marginal density by Newton and Raftery (1994) and Chib (1995).

References

X. Zhang and R. D. Brooks and M. L. King (2009) A Bayesian approach to bandwidth selection for multivariate kernel regression with an application to state-price density estimation, Journal of Econometrics, 153, 21-32. S. Chib (1995) Marginal likelihood from the Gibbs output, Journal of the American Statistical Association, 90, 432, 1313-1321. M. A. Newton and A. E. Raftery (1994) Approximate Bayesian inference by the weighted likelihood bootstrap (with discussion), Journal of the Royal Statistical Society, 56, 3-48.

See Also

bbelogdensity, bbelogpriors, bbeloglikelihood

Examples

Run this code
dummy = bbewarmup(nrr(data_x), bbecost(data_x, data_y, nrr(data_x)), warm = 2)
bbeMCMCrecording(data_x, data_y, dummy$xh, dummy$cost, num_batch = 2, M = 4, step = 2)

Run the code above in your browser using DataLab