Description Usage Arguments Details Author(s) References See Also Examples

This function plots the estimated functions from a model estimated using `flam`

. The user specifies the model of interest (i.e., the tuning parameters) and a plot is made for the estimated association between all non-sparse (or a chosen subset of) features and the outcome.

1 2 3 4 |

`x` |
an object of class "flam". |

`index` |
the index for the model of interest to be plotted. Note that |

`n.plot` |
the number of predictors to be plotted (default of 10). Note that only non-sparse predictors are plotted, however, this argument is ignored if |

`predictor.indicators` |
a vector indicating which predictor function estimates to plot. The vector should contain the column numbers of |

`predictor.labels` |
a vector containing the predictor labels of the same length as |

`outcome.label` |
the name of the outcome used in the y-axis label. By default, the label is "outcome". |

`ticks` |
a logical ( |

`col` |
a vector of colors used to plot the function estimates. If |

`n.panel.width` |
the plots will be plotted with |

`n.panel.height` |
the plots will be plotted with |

`...` |
additional arguments to be passed. These are ignored in this function. |

The estimated function fits are drawn by connecting the predictions for all of the observations in `x$x`

. This may result in fits that appear not to be piecewise consant if only a single observation is observed for a range of x-values.

Ashley Petersen

Petersen, A., Witten, D., and Simon, N. (2014). Fused Lasso Additive Model. arXiv preprint arXiv:1409.5391.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
#See ?'flam-package' for a full example of how to use this package
#generate data
set.seed(1)
data <- sim.data(n = 50, scenario = 1, zerof = 10, noise = 1)
#fit model for a range of tuning parameters
flam.out <- flam(x = data$x, y = data$y, alpha.seq = c(0.8, 0.9, 1))
#we plot the predictor fits for a specific index, e.g. 25
#that is, lambda and alpha of
flam.out$all.lambda[25]; flam.out$all.alpha[25]
plot(flam.out, index = 25)
#the fit only has 5 non-sparse features
#by default, up to 10 non-sparse features with the largest L2 norms are
#plotted, but we can plot a different number of features if desired
plot(flam.out, index = 40, n.plot = 12)
#or we can plot specific predictors of interest
plot(flam.out, index = 40, predictor.indicators = c(1:4, 6, 8, 11, 12))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.