Learn R Programming

bbefkr (version 4.2)

bayMCMC_np_local: Bayesian bandwidth estimation for a functional nonparametric regression with homoscedastic errors

Description

Estimate the bandwidths in the regression function approximated by the functional Nadaraya-Watson estimator and kernel-form error density with localised bandwidths, in a functional nonparametric regression

Usage

bayMCMC_np_local(data_x, data_y, data_xnew, warm = 1000, M = 1000, mutprob = 0.44, errorprob = 0.44, epsilonprob = 0.44, mutsizp = 1, errorsizp = 1, epsilonsizp = 1, prior_alpha = 1, prior_beta = 0.05, err_int = c(-10, 10), err_ngrid = 10001, num_batch = 20, step = 10, alpha = 0.95, ...)

Arguments

data_x
An (n by p) matrix of discretised data points of functional curves
data_y
A scalar-valued response of length n
data_xnew
A matrix of discretised data points of new functional curve(s)
warm
Number of iterations for the burn-in period
M
Number of iterations for the Markov chain Monte Carlo (MCMC)
mutprob
Optimal acceptance rate of the random-walk Metropolis algorithm for sampling the bandwidth in the regression function
errorprob
Optimal acceptance rate of the random-walk Metropolis algorithm for sampling the bandwidth in the kernel-form error density
epsilonprob
Optimal acceptance rate of the random-walk Metropolis algorithm for sampling the bandwidth adjust factor in the kernel-form error density
mutsizp
Initial step length of the random-walk Metropolis algorithm for sampling the bandwidth in the regression function. Its value will be updated at each iteration to achieve the optimal acceptance rate, given the MCMC converges to its target distribution
errorsizp
Initial step length of the random-walk Metropolis algorithm for sampling the bandwidth in the kernel-form error density. Its value will be updated at each iteration to achieve the optimal acceptance rate, given the MCMC converges to its target distribution
epsilonsizp
Initial step length of the random-walk Metropolis algorithm for sampling the bandwidth adjustment factor in the kernel-form error density. Its value will be updated at each iteration to achieve the optimal acceptance rate
prior_alpha
Hyperparameter of the inverse gamma prior distribution for the squared bandwidths
prior_beta
Hyperparameter of the inverse gamma prior distribution for the squared bandwidths
err_int
Range of the error-density grid for computing the probability density function and cumulative probability density function
err_ngrid
Number of the error-density grid points
num_batch
Number of batches to assess the convergence of the MCMC
step
Thinning parameter. For example, when step=10, it keeps every 10th iteration of the MCMC output
alpha
The nominal coverage probability of the prediction interval, customarily 95 percent
...
Other arguments used to define semi-metric. For a set of smoothed functional data, the semi-metric based on derivative is suggested. For a set of rough functional data, the semi-metric based on the functional principal component analysis is suggested

Value

xpfinalres
Estimated bandwidths
mhat
Estimated regression function
sif_value
Simulation inefficiency factor
mlikeres
Marginal likelihood calculated using the Chib's (1995) method
acceptnwMCMC
Acceptance rate for sampling bandwidth in the regression function
accepterroMCMC
Acceptance rate for sampling bandwidth in the kernel-form error density
acceptepsilonMCMC
Acceptance rate for sampling bandwidth adjustment factor in the kernel-form error density
fore.den.mkr
Estimated probability density function of the error
fore.cdf.mkr
Estimated cumulative density function of the error
point forecast
Predicted response
PI
Prediction interval of response

Details

The Bayesian method estimates the bandwidths in the regression function and kernel-form error density. It performs better than the functional cross validation in terms of estimation accuracy, since the latter one does not utilise the information about the unknown error density. Furthermore, it can estimate error density more accurate than the Bayesian method with a global bandwidth

References

H. L. Shang (2013) Bayesian bandwidth estimation for a semi-functional partial linear regression model with unknown error density, Computational Statistics, in press.

H. L. Shang (2013) Bayesian bandwidth estimation for a functional nonparametric regression model with unknown error density, Computational Statistics and Data Analysis, 67, 185-198.

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.

F. Ferraty, I. Van Keilegom and P. Vieu (2010) On the validity of the bootstrap in non-parametric functional regression, Scandinavian Journal of Statistics, 37, 286-306.

R. Meyer and J. Yu (2000) BUGS for a Bayesian analysis of stochastic volatility models, Econometircs Journal, 3(2), 198-215.

S. Chib (1995) Marginal likelihood from the Gibbs output, Journal of the American Statistical Association, 90(432), 1313-1321.

See Also

bayMCMC_np_global, bayMCMC_semi_local