Learn R Programming

bbemkr (version 1.2)

bbeMCMCrecording: MCMC iterations

Description

Estimated averaged bandwidths of the regressors and averaged variance parameter of the error density

Usage

bbeMCMCrecording(data_x, data_y, x, costpara, kerntype = c("Gaussian", 
                 "Epanechnikov", "Quartic", "Triweight", "Triangular", 
                 "Uniform"), 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, obtained after the warmup (also known as burin) period
costpara
Retained cost value, obtained after the warmup period
kerntype
Type of kernel function. By default, Gaussian kernel is used
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 eliminate correlation
sizep
Tuning parameters of the bandwidths. The acceptance rate is determined by the sizep.

Value

  • accept_raterecordingAcceptance rate of the random-walk Metropolis algorithm
  • sum_hEstimated parameters in an order of the bandwidths of the regressors, the variance parameter of the error density, likelihood and cost value
  • std_hStandard deviation of the estimated parameters
  • batch_hStandard deviation of the estimated parameters from different draws (equal to num_batch)
  • total_sdTotal standard deviation of the estimated 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 used 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

Akin to the warmup period, it determines the retained bandwidths for the regressors and the variance of the error density for finite samples. It also calculates the simulation inefficient factor (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