cm_MSE: Mean squared error

Description Usage Arguments Value Examples

View source: R/cm_MSE.R

Description

This function computes in a very simple way the mean squared error from a vector of observations and a vector of predictions

Usage

1
cm_MSE(y, yhat)

Arguments

y

Response variable observations

yhat

Response variable predictions

Value

The mean squared error of prediction

Examples

1
2
3
4
5
6
7
8
set.seed(8675309)
n = 1000
x1 = rnorm(n)
x2 = rnorm(n)
y = 1 + .5*x1 + .2*x2 + rnorm(n)
X=cbind(x1,x2)
yhat <- cm_predict()
cm_MSE(y, yhat)

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