check.func: check loss function

Description Usage Arguments Details Value Note Author(s) Examples

Description

Calculates the check loss function.

Usage

1
check.func(u, p)

Arguments

u

Value to be evaluated

p

Probability level [0,1]

Details

The check loss is calculated as ρ_{p} (u) = (abs(u) + (2*p-1)*u)/2.

Value

The check loss for value u and probability level p.

Note

This function is used within quantileScore.

Author(s)

Sabrina Bentzien

Examples

1
2
3
4
5
## The function is currently defined as
function (u, p) 
{
    rho <- (abs(u) + (2 * p - 1) * u) * 0.5
  }

Example output

Loading required package: fields
Loading required package: spam
Loading required package: dotCall64
Loading required package: grid
Spam version 2.1-1 (2017-07-02) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

    backsolve, forwardsolve

Loading required package: maps
Loading required package: boot
Loading required package: CircStats
Loading required package: MASS
Loading required package: dtw
Loading required package: proxy

Attaching package: 'proxy'

The following object is masked from 'package:spam':

    as.matrix

The following objects are masked from 'package:stats':

    as.dist, dist

The following object is masked from 'package:base':

    as.matrix

Loaded dtw v1.18-1. See ?dtw for help, citation("dtw") for use in publication.

function (u, p) 
{
    rho <- (abs(u) + (2 * p - 1) * u) * 0.5
}

verification documentation built on May 2, 2019, 1:24 a.m.