# functionalANOVA: generalized functional analysis of variance In zmjones/fanova: Functional ANOVA Decomposition of Prediction Functions

## Description

computes a generalized (weighted) functional ANOVA decomposition of a prediction function, giving the best additive decomposition of the prediction function in terms of squared error.

## Usage

 ```1 2 3``` ```functionalANOVA(data, vars, n = c(10, 2), model, predict.fun = function(object, newdata) predict(object, newdata = newdata), weight.fun = NULL) ```

## Arguments

 `data` a `data.frame` or `data.table` which contains the features/covariates on which `predict.fun` was learned/estimated. `vars` a `character` vector which corresponds to a subset of the columns of `data`. `n` a `numeric` vector of length 2, where the first element corresponds to the dimension of the grid constructed for each of the elements of `vars` and the second element to the number of rows to sample from `data`. `model` the first argument to `predict.fun`, presumably a model object which can make predictions. `predict.fun` a `function` whose first two arguments are "object" and "newdata" which returns a numeric vector the same length as the number of rows in newdata. the default value is to call the `predict` method on the `model`. `weight.fun` a `function` with two arguments, `design` and `data`, both of which are `data.tables` which returns a `numeric` of the same length as the number of rows in `design`. this is intended for use to use the `data` to estimate the distribution of the input features, and then to use that estimate to the probability of points in the `design` grid.

## Value

a `data.table` with columns for a grid of points of the `vars`, a (set of) column(s) that correspond to the estimated effect of those features/covariates on the prediction function, and a column `effect` which indicates which subset of the covariates/features each estimate belongs to.

## References

Giles Hooker. Generalized Functional ANOVA Diagnostics for High Dimensional Functions of Dependent Variables, Journal of Computational and Graphical Statistics, Vol. 16, No. 3 (2007), pp. 709-732.

zmjones/fanova documentation built on May 4, 2019, 11:24 p.m.