adjustIntercept {actuaRE} | R Documentation |
Adjust the intercept to regain the balance property
Description
This function updates the intercept term of the model fit such that the balance property is satisfied.
Usage
adjustIntercept(obj, data)
Arguments
obj |
an object of type |
data |
a |
Value
The object with the adjusted (fixed effects) coefficients.
References
Campo, B.D.C. and Antonio, Katrien (2023). Insurance pricing with hierarchically structured data an illustration with a workers' compensation insurance portfolio. Scandinavian Actuarial Journal, doi: 10.1080/03461238.2022.2161413
Wüthrich, M. V. (2020). Bias regularization in neural network models for general insurance pricing. European actuarial journal 10(1), 179–202.
Examples
library(statmod)
datas = dataCar[1:1e3, ]
Fit = glm(Y ~ area + gender, data = datas, weights = datas$w, family = tweedie(1.75, 0),
model = TRUE, control = glm.control(epsilon = 1e-4, maxit = 5e2))
w = weights(Fit, "prior")
y = Fit$y
sum(w * y) == sum(w * fitted(Fit))
adjFit = adjustIntercept(Fit, datas)
coef(adjFit)
sum(w * y) == sum(w * fitted(adjFit))
[Package actuaRE version 0.1.5 Index]