prstReg {ImpShrinkage}R Documentation

The positive-rule Stein estimator

Description

This function calculates the positive-rule Stein estimator. This estimator is an improved version of the Stein estimator, where only the positive part of the shrinking factor is considered. It may be calculated by

\hat{\beta}^{S+}= \hat{\beta}^{S} + (1 + d \mathcal{L}^{-1}) I(\mathcal{L} > d) (\hat{\beta}^{U} - \hat{\beta}^{R})

where I(A) denotes an indicator function and

Usage

prstReg(X, y, H, h, d = NULL, is_error_normal = FALSE)

Arguments

X

Matrix with input observations, of dimension n x p; each row is an observation vector.

y

Vector with response observations of size n.

H

A given q x p matrix.

h

A given q x 1 vector.

d

(optional) If not provided (or set to NULL), it will be calculated using \frac{{(q - 2) \cdot (n - p)}}{{q \cdot (n - p + 2)}}.

is_error_normal

logical value indicating whether the errors follow a normal distribution. If is_error_normal is TRUE, the distribution of the test statistics for the null hypothesis is F distribution (FDist). On the other hand, if the errors have a non-normal distribution, the asymptotic distribution of the test statistics is \chi^2 distribution (Chisquare). By default, is_error_normal is set to FALSE.

Details

The corresponding estimator of \sigma^2 is given by

s^2 = \frac{1}{n-p}(y-X\hat{\beta}^{S+})^{\top}(y - X\hat{\beta}^{S+}).

Value

An object of class pst is a list containing at least the following components:

coef

A named vector of coefficients.

residuals

The residuals, that is, the response values minus fitted values.

s2

The estimated variance.

fitted.values

The fitted values.

References

Saleh, A. K. Md. Ehsanes. (2006). Theory of Preliminary Test and Stein‐Type Estimation With Applications, Wiley.

Kaciranlar, S., Akdeniz, S. S. F., Styan, G. P. & Werner, H. J. (1999). A new biased estimators in linear regression and detailed analysis of the widely-analysed dataset on portland cement. Sankhya, Series B, 61(3), 443-459.

Kibria, B. M. Golam (2005). Applications of Some Improved Estimators in Linear Regression, Journal of Modern Applied Statistical Methods, 5(2), 367- 380.

Examples

n_obs <- 100
p_vars <- 5
beta <- c(2, 1, 3, 0, 5)
simulated_data <- simdata(n = n_obs, p = p_vars, beta)
X <- simulated_data$X
y <- simulated_data$y
p <- ncol(X)
# H beta = h
H <- matrix(c(1, 1, -1, 0, 0, 1, 0, 1, 0, -1, 0, 0, 0, 1, 0), nr = 3, nc = p, byrow = TRUE)
h <- rep(0, nrow(H))
prstReg(X, y, H, h)

# H beta != h
H <- matrix(c(1, 1, -1, 0, 0, 1, 0, 1, 0, -1, 0, 0, 0, 1, 0), nr = 3, nc = p, byrow = TRUE)
h <- rep(1, nrow(H))
prstReg(X, y, H, h)

data(cement)
X <- as.matrix(cbind(1, cement[, 1:4]))
y <- cement$y
# Based on Kaciranlar et al. (1999)
H <- matrix(c(0, 1, -1, 1, 0), nrow = 1, ncol = 5, byrow = TRUE)
h <- rep(0, nrow(H))
prstReg(X, y, H, h)
# Based on Kibria (2005)
H <- matrix(c(0, 1, -1, 1, 0, 0, 0, 1, -1, -1, 0, 1, -1, 0, -1), nrow = 3, ncol = 5, byrow = TRUE)
h <- rep(0, nrow(H))
prstReg(X, y, H, h)


[Package ImpShrinkage version 1.0.0 Index]