gdlm: Fit a linear model using an arbitrary loss function

Description Usage Arguments Note Author(s) Examples

Description

Fit a linear model using gradient descent methods. Given a loss function, gdlm will minimize summed loss across observations. Optionally generate bootstrapped standard errors & confidence intervals for estimators.

Usage

1
2
gdlm(formula, data, loss, bootstrapped_se = TRUE, bootstrap_trials = 100,
  initial_estimators = NULL)

Arguments

formula

the form of the linear model to be fit

data

the dataset used to fit the model

loss

a function accepting a vector of parameter estimators, a matrix of training data, and a vector of responses. represents the loss at the current model parameterization

bootstrapped_se

whether to perform bootstrapping to generate standard errors and confidence intervals

initial_estimators

the starting fit used by gradient descent. default is zeros

boostrap_trials

how many bootstrap trials to perform

Note

It is left to the user to consider the convexity of the summed loss function. For non-convex loss, gradient descent methods may not be generally appropriate.

The user can control the parallelism of bootstrapping by setting

The loss and gradient arguments are currently mutually exclusive, although some gradient descent methods can take advantage of them simultaneously. This may be subject to change in the future.

Author(s)

kholub

Examples

1
m <- gdlm(Sepal.Width ~ Species * Petal.Width + Petal.Length, data = iris, loss = LS_LOSS)

holub008/gdlm documentation built on May 13, 2019, 6:14 p.m.