Learn R Programming

bbemkr (version 2.0)

cost_gaussian: Negative of log posterior associated with the bandwidths

Description

Calculates the negative of log posterior, using the leave-one-out cross validated samples.

Usage

cost_gaussian(x, data_x, data_y, prior_p, prior_st)

Arguments

x
Log of square bandwidths
data_x
Regressors
data_y
Response variable
prior_p
A tuning parameter of the prior of error variance, following inverse gamma distribution
prior_st
Another tuning parameter of the prior of error variance, following inverse gamma distribution

Value

Value of the cost function

Details

Bandwidth can be re-parameterized by a constant times optimal convergence rate, that is, $h=c*n^{rate}$. The prior of $c^2$ is assumed to follow an inverse-gamma prior with hyperparameters prior_p = 2 and prior_st = 1.

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.

See Also

np_gibbs, cost2_gaussian

Examples

Run this code
x = log(nrr(data_x, FALSE)^2)
inicost = cost_gaussian(x, data_x = data_x, data_y = data_ynorm, prior_p = 2, prior_st = 1)

Run the code above in your browser using DataLab