Learn R Programming

modello (version 0.1.1)

mse.modello_number: Mean Squared Error

Description

Mean Squared Error between target values and predictions $$mse = \sum_i^N{(y_i - \hat y_i)^2} / N$$

Usage

# S3 method for modello_number
mse(y, yh)

# S3 method for default mse(y, yh)

mse(y, yh)

Arguments

y

target values

yh

predictions

Value

Returns the mse

Examples

Run this code
# NOT RUN {
modello.init(10, 10, 10, 10)
## For modello_numbers
y = number(rnorm(10), dx=FALSE)
yh = number(rnorm(10))
h = mse(y, yh)
print(h)
print(h$v)
modello.close()
## For numerics
y = rnorm(10)
yh = rnorm(10)
h = mse(y, yh)
print(h)
# }

Run the code above in your browser using DataLab