gam.style: GAM-style effects plots for interpreting MLP and MONMLP...

Description Usage Arguments Value References See Also Examples

Description

GAM-style effects plots provide a graphical means of interpreting fitted covariate/response relationships. From Plate et al. (2000): The effect of the ith input variable at a particular input point Delta.i.x is the change in f resulting from changing X1 to x1 from b1 (the baseline value [...]) while keeping the other inputs constant. The effects are plotted as short line segments, centered at (x.i, Delta.i.x), where the slope of the segment is given by the partial derivative. Variables that strongly influence the function value have a large total vertical range of effects. Functions without interactions appear as possibly broken straight lines (linear functions) or curves (nonlinear functions). Interactions show up as vertical spread at a particular horizontal location, that is, a vertical scattering of segments. Interactions are present when the effect of a variable depends on the values of other variables.

Usage

1
2
3
gam.style(x, weights, column, baseline = mean(x[,column]),
         epsilon = 1e-5, seg.len = 0.02, seg.cols = "black",
         plot = TRUE, return.results = FALSE, ...)

Arguments

x

matrix with number of rows equal to the number of samples and number of columns equal to the number of covariate variables.

weights

list returned by monmlp.fit.

column

column of x for which effects plots should be returned.

baseline

value of x[,column] to be used as the baseline for calculation of covariate effects; defaults to mean(x[,column]).

epsilon

step-size used in the finite difference calculation of the partial derivatives.

seg.len

length of effects line segments expressed as a fraction of the range of x[,column].

seg.cols

colors of effects line segments.

plot

if TRUE (the default) then an effects plots for each response variable is produced.

return.results

if TRUE then values of effects and partial derivatives for each response variable are returned.

...

further arguments to be passed to plot.

Value

A list with elements:

effects

a matrix of covariate effects.

partials

a matrix of covariate partial derivatives.

References

Cannon, A.J. and I.G. McKendry, 2002. A graphical sensitivity analysis for interpreting statistical climate models: Application to Indian monsoon rainfall prediction by artificial neural networks and multiple linear regression models. International Journal of Climatology, 22:1687-1708.

Plate, T., J. Bert, J. Grace, and P. Band, 2000. Visualizing the function computed by a feedforward neural network. Neural Computation, 12(6): 1337-1354.

See Also

monmlp.fit, monmlp.predict

Examples

1
2
3
4
5
6
7
8
9
set.seed(1)
x <- matrix(runif(350*6), ncol=6)
y <- as.matrix(5*sin(10*x[,1]*x[,2]) + 20*(x[,3]-0.5)^2 -
               10*x[,4] + 20*x[,5]*x[,6])

w <- monmlp.fit(x = x, y = y, hidden1 = 4, n.trials = 1,
                iter.max = 500)

for (i in seq(ncol(x))) gam.style(x, weights = w, column = i)

Example output

Loading required package: optimx
** Ensemble 1 
0.1007287 
** 0.1007287 

dev.new(): using pdf(file="Rplots1.pdf")
dev.new(): using pdf(file="Rplots2.pdf")
dev.new(): using pdf(file="Rplots3.pdf")
dev.new(): using pdf(file="Rplots4.pdf")
dev.new(): using pdf(file="Rplots5.pdf")

monmlp documentation built on May 2, 2019, 11:14 a.m.