mse | R Documentation |
Calculate the mean-squared error for predicted vs observed continuous outcomes.
mse(preds, obs)
preds |
A vector of predicted continuous outcomes. |
obs |
A vector containing the observed continuous outcomes. |
The Mean Squared Error (MSE) given by
MSE = \frac{1}{N} \sum (y - \hat y)^2
# Generate some predictions
predictions <- rnorm(1000)
# Generate some observed outcomes
observations <- rnorm(1000)
# Calculate the MSE
mse(predictions, observations)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.