shakeWAR: Estimates the variance of openWAR

Description Usage Arguments Details Value Examples

Description

Resample to obtain variance estimates for WAR.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
shakeWAR(data, N = 10, resample = "plays", ...)

## S3 method for class 'list'
shakeWAR(data, N = 10, resample = "plays", ...)

## S3 method for class 'openWARPlays'
shakeWAR(data, N = 10, resample = "plays", ...)

## S3 method for class 'GameDayPlays'
shakeWAR(data, N = 10, resample = "plays", ...)

Arguments

data

An object that contains GameDayPlays data or data that has already been processed by makeWAR.

N

the number of resamples (default 10)

resample

An element of c('plays', 'models', 'both'). Currently only plays and both are implemented. Only works with shakeWAR.GameDayPlays method.

...

additional arguments passed to shakeWAR methods

Details

The general idea is to use resampling techniques to compute variance estimates for openWAR. The resample argument controls how that resampling is done.

For resample = 'plays', makeWAR is run on the actual plays passed in the data argument, if it hasn't been computed already. The resulting RAA values (for each play) are an estimate of what actually happened. These RAA values are resampled N times.

resample = 'models' is not currently implemented, but in future versions, this option would allow you to resample the rows of the original data, run makeWAR on each resampled data set, collect all of the models generated during that process, and then evaluate the original data using each of the resampled models. This would allow you isolate the modeling error.

For resample = 'both', the plays are resampled, and makeWAR is computed on each resampled data set. Note that this is both computationally and memory intensive.

Value

a do.openWARPlayers data frame with RAA values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
res <- shakeWAR(May, resample='plays', N=5)
summary(res)

## End(Not run)

## Not run: 
owar <- shakeWAR(MayProcessed, N = 5)
summary(owar)

## End(Not run)
## Not run: 
owar <- shakeWAR(MayProcessed$openWAR, N = 5)
summary(owar)

## End(Not run)
## Not run: 
owar <- shakeWAR(May, N = 7)
summary(owar)
owar <- shakeWAR(May, N = 2, resample = "both")
summary(owar)

## End(Not run)

beanumber/openWAR documentation built on May 12, 2019, 9:43 a.m.