mspeFHpb: Compute MSPE through parameter bootstrap method for Fay...

View source: R/RcppExports.R

mspeFHpbR Documentation

Compute MSPE through parameter bootstrap method for Fay Herriot model

Description

This function returns MSPE estimator with parameter bootstrap method for Fay Herriot model.

Usage

mspeFHpb(formula, data, D, K = 50, method = 4, na_rm, na_omit)

Arguments

formula

(formula). Stands for the model formula that specifies the auxiliary variables to be used in the regression model. This should follow the R model formula syntax.

data

(data frame). It represents the data containing the response values and auxiliary variables for the Nested Error Regression Model.

D

(vector). It represents the knowing sampling variance for Fay Herriot model.

K

(integer). It represents the bootstrap sample number. Default value is 50.

method

The variance component estimation method to be used. See "Details".

na_rm

A logical value indicating whether to remove missing values (NaN) from the input matrices and vectors. If TRUE, missing values in the input data (X, Y, and D) are automatically cleaned using internal functions. If FALSE, missing values are not removed. Defaults to FALSE.

na_omit

A logical value indicating whether to stop the execution if missing values (NaN) are present in the input data. If TRUE, the function will check for missing values in X, Y, and D. If any missing values are found, an error message will be raised, prompting the user to handle the missing data before proceeding. Defaults to FALSE.

Details

This method was proposed by Peter Hall and T. Maiti. Parametric bootstrap (pb) method uses bootstrap-based method to measure the accuracy of the EB estimator. In this case, only EB estimator is available (method = 4).

Value

This function returns a list with components:

MSPE

(vector) MSPE estimates for Fay Herriot model.

bhat

(vector) Estimates of the unknown regression coefficients.

Ahat

(numeric) Estimates of the variance component.

Author(s)

Peiwen Xiao, Xiaohui Liu, Yu Zhang, Yuzi Liu, Jiming Jiang

References

F. B. Butar and P. Lahiri. On measures of uncertainty of empirical bayes small area estimators. Journal of Statistical Planning and Inference, 112(1-2):63-76, 2003.

N. G. N. Prasad and J. N. K. Rao. The estimation of the mean squared error of small-area estimators. Journal of the American Statistical Association, 85(409):163-171, 1990.

Peter Hall and T. Maiti. On parametric bootstrap methods for small area prediction. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 2006a.

H. T. Maiti and T. Maiti. Nonparametric estimation of mean squared prediction error in nested error regression models. Annals of Statistics, 34(4):1733-1750, 2006b.

Examples

X <- matrix(runif(10 * 3), 10, 3)
X[,1] <- rep(1, 10) 
D <- (1:10) / 10 + 0.5
Y <- X %*% c(0.5, 1, 1.5) + rnorm(10, 0, sqrt(2)) + rnorm(10, 0, sqrt(D))
data <- data.frame(Y = Y, X1 = X[,2], X2 = X[,3])
formula <- Y ~ X1 + X2
result <- mspeFHpb(formula, data, D, K = 50, method = 4)

saeMSPE documentation built on April 4, 2025, 5:18 a.m.