Description Usage Arguments Value
View source: R/full_logistic_reg.R
logistic_reg function that performs logistic regression, implemented here for baseline unit testing. This is almost identical to RcppNumerical::fastLR.
1 2 3 4 5 6 7 8 | logistic_reg(
x,
y,
start = rep(0, ncol(x)),
eps_f = 1e-08,
eps_g = 1e-05,
maxit = 300
)
|
x |
the design matrix, with predictors as columns. |
y |
the response vector. |
start |
The initial guess of the coefficient vector. |
eps_f |
Iteration stops if |f-f'|/|f|<eps_f, where f and f' are the current and previous value of the objective function (negative log likelihood) respectively. |
eps_g |
Iteration stops if ||g|| < eps_g * max(1, ||beta||), where beta is the current coefficient vector and g is the gradient. |
maxit |
Maximum number of iterations. |
a list with the following components:
coefficients |
Coefficient vector |
fitted.values |
The fitted probability values |
linear.predictors |
The fitted values of the linear part, i.e., X * beta_hat |
loglikelihood |
The maximized log likelihood |
converged |
Whether the optimization algorithm has converged |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.