Description Usage Arguments Value Examples
monte-carlo integration of prediction functions
1 2 3 4 |
data |
a |
vars |
a character vector corresponding to a strict subset of the columns in |
n |
an integer vector of length two giving the resolution of the uniform or random grid on |
model |
an object which can be passed to |
uniform |
logical indicating whether to create the grid on |
points |
a named list which gives specific points for |
int.points |
a integer vector giving indices of the points in |
aggregate.fun |
what function to aggregate the predictions with. this function takes a single argument |
predict.fun |
what function to generate predictions using |
weight.fun |
a function to construct weights for |
a data.table
with columns for predictions and vars
.
1 2 3 4 5 6 7 | X = replicate(3, rnorm(100))
y = X %*% runif(3)
data = data.frame(X, y)
fit = lm(y ~ ., data)
marginalPrediction(data.frame(X), "X2", c(10, 25), fit,
aggregate.fun = function(x) c("mean" = mean(x), "variance" = var(x)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.