adjustIntercept {actuaRE} | R Documentation |
This function updates the intercept term of the model fit such that the balance property is satisfied.
adjustIntercept(obj, data)
obj |
an object of type |
data |
a |
The object with the adjusted (fixed effects) coefficients.
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.
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))