lm.mse: Calculate mse

View source: R/fit_helper.r

lm.mseR Documentation

Calculate mse

Description

Calculate mse

Usage

lm.mse(X, Y, mod = NULL, est.b = NULL, log.level = NULL)

Arguments

X

covariates (n times p matrix, n: number of entries, p: number of covariates)

Y

response (vector with n entries)

mod

fitted model from lm.cv or csuv. Only provide mod or est.b

est.b

estimated coefficient (with intercept). Only provide mod or est.b

log.level

log level to set. Default is NULL, which means no change in log level. See the function CSUV::set.log.level for more details

Value

the value of estimated mean square error

Examples

X = matrix(rnorm(1000), nrow = 100)
Y = rowSums(X[,1:3])+rnorm(100)
compare.mod = lm.compare.method(X, Y, intercept = FALSE)
lm.mse(X, Y, est.b = compare.mod)

christineyuen/CSUV documentation built on June 13, 2022, 1:41 a.m.