coefficients.restricted {ImpShrinkage}R Documentation

Extract Model Coefficients

Description

Coefficients extracted from the model object restrcited.

Usage

## S3 method for class 'restricted'
coefficients(object, ...)

## S3 method for class 'restricted'
coef(object, ...)

Arguments

object

An object of class restricted.

...

Other arguments.

Value

A vector of coefficients.

See Also

coefficients.unrestricted, coefficients.preliminaryTest, coefficients.improvedpreliminaryTest, coefficients.stein, coefficients.positivestein, coef.unrestricted, coef.preliminaryTest, coef.improvedpreliminaryTest coef.stein, coef.positivestein.

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), nrow = 3, ncol = p, byrow = TRUE)
h <- rep(0, nrow(H))
model <- resReg(X, y, H, h)
coefficients(model)
coef(model)

[Package ImpShrinkage version 1.0.0 Index]