cm_predict: Predict

Description Usage Arguments Value Examples

View source: R/cm_predict.R

Description

This function computes the prediction

Usage

1

Arguments

X

matrix of covariates observations

beta

vector of parameters of a linear regression model

Value

The mean squared error of prediction

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(8675309)
n = 1000
x1 = rnorm(n)
x2 = rnorm(n)
y = 1 + .5*x1 + .2*x2 + rnorm(n)
X=cbind(x1,x2)
b_pre <- c(0,0,0)
beta <- basic_sd(y, X, b_pre)
cm_predict(X, beta)
cm_LOOCV(y, X, b_pre = c(0,0,0))

FedericoCortese/R4DScm documentation built on July 12, 2021, 5:30 a.m.