modeval: Model Evaluate

Description Usage Arguments Value Examples

View source: R/vava_funset.R

Description

Evaluate models by calculate error of fitting.

Usage

1
modeval(y, y_hat, method = c("all", "MRE", "MAE", "RMSE", "Theil"))

Arguments

y

original series

y_hat

fitted or forecasted series by certain model

method

how to calculate the error of y and y_hat, default is all, otherwise, MRE: mean relative error, MAE: mean absolute error, RMSE: Root Mean Square Error, Theil: Theil coefficient.

Value

err a vector store the error of model calculated by method.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x<-c(1,3,NA,3,56,2,6)
y<-c(1.1,2.3,NA,2.7,53,2.5,6.8)
x;y
modeval(x,y)
modeval(x,y,"MRE")
modeval(x,y,"MAE")
modeval(x,y,method="RMSE")
modeval(x,y,method="Theil")

modeval(x,y,method="Theilxxx") # fail
modeval(x, y , method = "R")
modeval(x, y , 9) # fail

Nisus-Liu/vava documentation built on May 7, 2019, 6:18 p.m.