Learn R Programming

errint (version 1.0)

measure: Measures

Description

measure creates an object of class c("measure", "list").

as.measure attempts to coerce its argument x into an object of class c("measure", class(x)). If this is not possible x is returned unchanged.

is.measure returns TRUE if x is an R object with "measure" as one of its classes. It returns FALSE otherwise.

Usage

measure(s, acc, f = function(x, y) { abs(x - y) })
as.measure(x)
is.measure(x)

Arguments

s
confidence level, e,g. s=0.05 for the standard 95 percent confidence interval.
acc
accuracy achieved by error intervals.
f
function used to compute error of intervals. See also 'Details'.
x
an R object.

Value

measure returns an object of class c("measure","list") with information regarding the error of a set of intervals.as.measure returns an object of class c("measure",class(x)) with information contained in x if possible. Returns x otherwise.is.measure returns TRUE if x is an R object with "measure" as one of its classes. FALSE otherwise.

References

Link to the scientific paper

Prada, Jesus, and Jose Ramon Dorronsoro. "SVRs and Uncertainty Estimates in Wind Energy Prediction." Advances in Computational Intelligence. Springer International Publishing, 2015. 564-577,

with theoretical background for this package is provided below.

http://link.springer.com/chapter/10.1007/978-3-319-19222-2_47

Examples

Run this code
measure(0.1,0.7)

measure(0.1,0.7,function(x,y){y-x})


l<-list(s=0.1,acc=0.78,f=function(x,y){abs(x-y)},err=0.02)
as.measure(l)

v<-c("a","b")
as.measure(v)


l<-list(s=0.1,acc=0.78,f=function(x,y){abs(x-y)},err=0.02)
is.measure(l)
res<-as.measure(l)
is.measure(res)

Run the code above in your browser using DataLab