Description Usage Arguments Value Examples
Wrapper function for using Poisson GLM with online SL. If the function is
called with initial=TRUE then fits a Poisson regression using the
specified formula and returns predicted values on data frame newX. Any
input for fit is ignored. This is called by onlinesl to obtain
starting values for the SGD algorithm. If the function is called with
inital=FALSE, the function computes a prediction on newX based
on the current fit and updates the value of fit by taking a
step in the direction of the gradient. The function returns a list with named
entries fit and pred. fit contains the current regression
parameter estimate, while pred contains the predictions on the
newX data frame.
1 2 |
Y |
The numeric input outcome |
X |
The data.frame of predictors (ignored if |
newX |
The data.frame to return predictions for. |
t |
The numeric step number (ignored if |
fit |
A list of the current fit with named entry theta corresponding to the regression parameter estimates at the previous iteration and formula corresponding to the regression formula used by the function. |
initial |
Boolean as to whether the function should be called to obtain initial regression parameter estimates or whether it should perform an SGD updating step |
formula |
The regression formula to be used, specified as a character |
stepSize |
A function evaluating what step size to use in the SGD
algorithm (ignored if |
initial |
A boolean indicating whether to execute the function for initial parameter estimates or for an sgd update step. |
fit An object of class SL.sgd.poisson. A named list with
entries theta and formula consisting of the current regression
parameter estimates and the regression formula.
pred Predictions on newX either based on an initial call to glm
(if initial = TRUE) or based on an SGD update (if initial=FALSE)
1 | Examples to come
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.