lm.mse: Calculate mse

Description Usage Arguments Examples

View source: R/fit_helper.r

Description

Calculate mse

Usage

1
lm.mse(X, Y, mod = NULL, est.b = 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 vsc. Only provide mod or est.b

est.b

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

Examples

1
2
3
4
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/VSC documentation built on Oct. 8, 2019, 10:45 a.m.