compute_epe: Generalization Error

Description Usage Arguments Details Value References

Description

This function computes expected test error in Monte Carlo simultion situation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
compute_epe(
  data,
  randx,
  testn,
  fit,
  test_set,
  randy = NULL,
  mcname = "mc",
  xname = "x",
  yname = "y",
  error = c("squared", "absolute"),
  distribution = FALSE,
  mod,
  formula,
  ...
)

Arguments

data

MC data set generated by mc_data.

randx

Random sample generator function for x.

testn

Test sample size

fit

True model function with x-named argument.

test_set

You can provide an independent test set instead of using randx and testn.

randy

Random sample generator function for error term.

mcname

column name of the MC sample. By default, "mc".

xname

column name of the data. By default, "x".

yname

column name of the response. By default, "y".

error

Choice of loss function. See loss.

distribution

return the error for each MC sample? FALSE by default. If TRUE, it gives the data.table.

mod

Model function.

formula

an object of class formula.

...

Additional arguments for mod. If you wand argument for randx or randy, define one.

Details

Given MC samples, compute test error using independent test set and average.

Value

Expected test error

References

Hastie, T., Tibshirani, R.,, Friedman, J. (2001). The Elements of Statistical Learning. New York, NY, USA: Springer New York Inc..


ygeunkim/youngtool documentation built on Dec. 14, 2019, 7:42 p.m.