pred.response {abundant}R Documentation

Predict the response with the fitted high-dimensional principal fitted components model

Description

Let x\in R^p denote the values of the p predictors. This function computes \widehat E(Y|X=x) using equation (8.1) of Cook, Forzani, and Rothman (2012).

Usage

pred.response(fit, newx=NULL)

Arguments

fit

The object returned by fit.pfc().

newx

A matrix with N rows and p columns where each row is an instance of x described above. If this argument is unspecified, then the fitted values are returned, i.e, newx=X, where X was the predictor matrix used in the call to fit.pfc().

Details

See Cook, Forzani, and Rothman (2012) for more information.

Value

A vector of response prediction with nrow(newx) entries.

Author(s)

Adam J. Rothman

References

Cook, R. D., Forzani, L., and Rothman, A. J. (2012). Estimating sufficient reductions of the predictors in abundant high-dimensional regressions. Annals of Statistics 40(1), 353-384.

See Also

fit.pfc

Examples

set.seed(1)
n=25
p=50
d=1
true.G = matrix(rnorm(p*d), nrow=p, ncol=d)
y=rnorm(n)
fy = y
E=matrix(rnorm(n*p), nrow=n, ncol=p) 
X=fy%*%t(true.G) + E
fit=fit.pfc(X=X, r=4, d=d, y=y, weight.type="diag")
fitted.values=pred.response(fit)
mean((y-fitted.values)^2)
plot(fitted.values, y)

n.new=100
y.new=rnorm(n.new)
fy.new=y.new
E.new=matrix(rnorm(n.new*p), nrow=n.new, ncol=p) 
X.new = fy.new%*%t(true.G) + E.new
mean((y.new - pred.response(fit, newx=X.new))^2)  


[Package abundant version 1.2 Index]