murphydiag: Murphy diagram object

Description Usage Arguments Details Value See Also

View source: R/murphydiag.R

Description

murphydiag constructs and returns an object of class murphydiag. It is a generic function with a default method, and additional methods for classes lm, randomForest, rq (from package quantreg).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
murphydiag(object, ...)

## Default S3 method:
murphydiag(object, y, type, level = NULL, xnames = NULL,
  ...)

## S3 method for class 'lm'
murphydiag(object, newdata = NULL, newy = NULL,
  type = "mean", xnames = NULL, ...)

## S3 method for class 'rq'
murphydiag(object, newdata = NULL, newy = NULL,
  xnames = NULL, ...)

## S3 method for class 'randomForest'
murphydiag(object, newdata = NULL, newy = NULL,
  xnames = NULL, ...)

Arguments

object

an object used to select a method.

...

further arguments passed to or from other methods.

y

an object convertible by as.vector containing observations.

type

a string specifying the type of forecast, e.g. "mean".

level

optional; single value in (0, 1); only required for certain values of type.

xnames

optional; a character vector with the forecasting methods' names.

newdata

optional; a data frame as in predict.lm leading to forecasts for newy.

newy

optional; a vector of observations corresponding to forecasts based on newdata.

Details

In the default version, the user specifies all relevant information (forecasts, realizations, information on the type of forecast) manually. Furthermore, murphydiag accepts fitted model objects from a few other packages:

Value

The output is an object of class murphydiag, which is a list containing the following components:

x a data frame of forecasts
y a vector of observations
functional a list that specifies the forecast functional, containing type and level (optional).

See Also

murphydiag_diff, c.murphydiag, [.murphydiag, plot.murphydiag


aijordan/murphydiagram2 documentation built on June 12, 2018, 3:29 p.m.