mse.R
mse <- function(forecast, true)
{
if (length(forecast) != length(true))
stop("MSE: the lengths of input vectors must be the same.")
err = mean((true - forecast)^2)
return(round(err, 6))
}
mse <- function(forecast, true)
{
if (length(forecast) != length(true))
stop("MSE: the lengths of input vectors must be the same.")
err = mean((true - forecast)^2)
return(round(err, 6))
}