Skip to contents

geosmooth estimates a smooth response, or a probability mass, from data given as a matrix of coordinates (one row per observation) or as a weighted graph. It provides local polynomial smoothing, model-averaged local polynomial smoothing, several forms of trend filtering, graph low-pass filtering, Hessian-energy regression, and estimators of probability mass and occupation density.

Start here

vignette("function-guide", package = "geosmooth") is organized by task. It lists every exported function, says which fitted models can predict at new points, and gives examples. browseVignettes("geosmooth") lists all installed guides. The online version of the guide links to the full reference.

Finding a function

The main functions, by task:

Local regression

fit.lps fits a local polynomial smoother and selects its settings by cross-validation. fit.malps averages the predictions of overlapping local polynomial fits.

Lifting trend filters

fit.lpl.tf penalizes the absolute residuals of local polynomial predictions. fit.slpl.tf adds a penalty that makes overlapping local predictions agree.

One-dimensional trend filters

fit.gaussian.trend.filtering fits a continuous response and fit.logistic.trend.filtering a binary response. assess.gaussian.trend.filtering and assess.logistic.trend.filtering test whether the response varies with the predictor and assess held-out prediction.

Graph smoothing

fit.metric.graph.lowpass smooths a response on the vertices of a graph by filtering its spectrum, and fit.graph.trend.filtering penalizes differences along the edges.

Hessian penalties

fit.ssrhe.hessian.regression penalizes estimated second derivatives with a quadratic penalty, and fit.ssrhe.hessian.l1.regression with an absolute-value penalty.

Probability mass

fit.density estimates probability mass over a fixed set of support points, fit.subject.od does so from the repeated visits of one subject, and normalize.density converts an existing fitted field to probability mass.

Synthetic examples

synthetic.spec describes a synthetic data set, and materialize.synthetic draws the data.

Author

Maintainer: Pawel Gajer pgajer@gmail.com

Authors:

Other contributors:

  • Gael Guennebaud (Eigen) [contributor]

  • Benoit Jacob (Eigen) [contributor]

  • Authors of Eigen (Authorship and copyright in the included Eigen library) [copyright holder]

  • Yixuan Qiu (Spectra) [contributor, copyright holder]

  • Contributors to Spectra (Copyright in the included Spectra library) [copyright holder]

  • Sunil Arya (ANN) [contributor, copyright holder]

  • David M. Mount (ANN) [contributor, copyright holder]

  • University of Maryland (ANN) [copyright holder]

Examples

X <- matrix(seq(0, 1, length.out = 30), ncol = 1)
y <- sin(2 * pi * X[, 1])
fit <- fit.lps(X, y, support.grid = 8L, degree.grid = 1L,
               kernel.grid = "tricube", foldid = rep(1:3, 10))
head(predict(fit))
#> [1] 0.0283661 0.2128329 0.3940040 0.5728866 0.7214988 0.8363744