logistic_solve1 | R Documentation |
Calculate y ~ sigmoid(a + b x) using iteratively re-weighted least squares. Zero indexed.
logistic_solve1(x, y, w, initial_link, i, j, skip)
x |
NumericVector, expanatory variable. |
y |
NumericVector, 0/1 values to fit. |
w |
NumericVector, weights (required, positive). |
initial_link, |
initial link estimates (required, all zeroes is a good start). |
i |
integer, first index (inclusive). |
j |
integer, last index (inclusive). |
skip |
integer, index to skip (-1 to not skip). |
vector of a and b.
set.seed(5)
d <- data.frame(
x = rnorm(10),
y = sample(c(0,1), 10, replace = TRUE)
)
weights <- runif(nrow(d))
m <- glm(y~x, data = d, family = binomial, weights = weights)
coef(m)
logistic_solve1(d$x, d$y, weights, rep(0.0, nrow(d)), 0, nrow(d)-1, -1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.