Description Usage Arguments Details Value References
This function computes expected test error in Monte Carlo simultion situation.
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,
...
)
|
data |
MC data set generated by |
randx |
Random sample generator function for |
testn |
Test sample size |
fit |
True model function with |
test_set |
You can provide an independent test set instead of using |
randy |
Random sample generator function for error term. |
mcname |
column name of the MC sample. By default, |
xname |
column name of the data. By default, |
yname |
column name of the response. By default, |
error |
Choice of loss function. See |
distribution |
return the error for each MC sample? |
mod |
Model function. |
formula |
an object of class formula. |
... |
Additional arguments for |
Given MC samples, compute test error using independent test set and average.
Expected test error
Hastie, T., Tibshirani, R.,, Friedman, J. (2001). The Elements of Statistical Learning. New York, NY, USA: Springer New York Inc..
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.