Description Usage Arguments Details Value See Also Examples
Reweighting functions that comprise an IRLS iteration
1 2 3 4 5 | init_weight(object)
weight(object, data)
end_weight(object, tolerance = 1e-08)
|
object |
|
data |
an optional |
tolerance |
Tolerance used to determine convergence. Represents change in coefficient as a multiple of standard error. |
The IRLS process comprises iterative calls to init_weight()
, weight()
and end_weight()
which can be managed via a single call to fit()
.
These comprising functions are exposed for lower level control of the fitting process.
oomglm
model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # initiate `oomglm` model and `oomdata_tbl`
x <- oomglm(mpg ~ cyl + disp)
chunks <- oomdata_tbl(mtcars, chunk_size = 10)
# manually perform one round of IRLS and check results
x <- init_weight(x)
x <- weight(x, data = chunks)
x <- end_weight(x)
print(x$converged)
print(coef(x))
# manually perform an additional round of IRLS
x <- init_weight(x)
x <- weight(x, data = chunks)
x <- end_weight(x)
print(x$converged)
print(coef(x))
# the IRLS process as implemented by `fit()`
# is similar to the following
x <- oomglm(mpg ~ cyl + disp)
chunks <- oomdata_tbl(mtcars, chunk_size = 10)
while(!x$converged) {
x <- init_weight(x)
x <- weight(x, data = chunks)
x <- end_weight(x)
}
tidy(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.