Squared Error SE calculated as
$$ (\textrm{true\_values} - \textrm{predicted\_values})^2 $$
Arguments
- true_values
A vector with the true observed values of size n
- predictions
A vector with predicted values of size n
Examples
true_values <- rnorm(30, mean = 1:30)
predicted_values <- rnorm(30, mean = 1:30)
squared_error(true_values, predicted_values)
#> [1] 2.3523322101 0.0061691598 3.3167837598 0.1358505899 2.9235116541
#> [6] 0.7451211099 0.3613231129 5.5953277714 0.1746762714 0.6286592006
#> [11] 0.6860349867 0.2186822602 1.3660616423 4.0649933447 0.1525477078
#> [16] 3.4218886406 0.8628059777 0.1360136300 7.8679710411 0.0008907361
#> [21] 0.1768343735 0.0998356868 4.9092461651 0.1573667428 9.1583503348
#> [26] 0.0516387075 0.1890724921 7.3359579828 0.0153858114 0.0093048935