Learn R Programming

greybox (version 2.0.2)

accuracy.greybox: Error measures for an estimated model

Description

Function produces error measures for the provided object and the holdout values of the response variable. Note that instead of parameters x, test, the function accepts the vector of values in holdout. Also, the parameters d and D are not supported - MASE is always calculated via division by first differences.

Usage

# S3 method for greybox
accuracy(object, holdout = NULL, ...)

# S3 method for predict.greybox accuracy(object, holdout = NULL, ...)

Arguments

object

The estimated model or a forecast from the estimated model generated via either predict() or forecast() functions.

holdout

The vector of values of the response variable in the holdout (test) set. If not provided, then the function will return the in-sample error measures.

...

Other variables passed to the forecast() function (e.g. newdata).

Author

Ivan Svetunkov, ivan@svetunkov.ru

Details

The function is a wrapper for the measures function and is implemented for convenience.

Examples

Run this code

xreg <- cbind(rlaplace(100,10,3),rnorm(100,50,5))
xreg <- cbind(100+0.5*xreg[,1]-0.75*xreg[,2]+rlaplace(100,0,3),xreg,rnorm(100,300,10))
colnames(xreg) <- c("y","x1","x2","Noise")

ourModel <- alm(y~x1+x2+trend, xreg, subset=c(1:80), distribution="dlaplace")
predict(ourModel,xreg[-c(1:80),]) |>
   accuracy(xreg[-c(1:80),"y"])

Run the code above in your browser using DataLab