Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reweight

Re-fitting Models with New Weights


Description

Generic function for re-fitting a model object using the same observations but different weights.

Usage

reweight(object, weights, ...)

Arguments

object

a fitted model object.

weights

a vector of weights.

...

arguments passed to methods.

Details

The method is not unsimilar in spirit to update, but much more narrowly focused. It should return an updated fitted model derived from re-fitting the model on the same observations but using different weights.

Value

The re-weighted fitted model object.

See Also

Examples

## fit cars regression
  mf <- dpp(linearModel, dist ~ speed, data = cars)
  fm <- fit(linearModel, mf)
  fm
  
  ## re-fit, excluding the last 4 observations
  ww <- c(rep(1, 46), rep(0, 4))
  reweight(fm, ww)

party

A Laboratory for Recursive Partytioning

v1.3-10
GPL-2
Authors
Torsten Hothorn [aut, cre] (<https://orcid.org/0000-0001-8301-0471>), Kurt Hornik [aut], Carolin Strobl [aut], Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>)
Initial release
2022-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.