-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bounds not working #10
Comments
Hi! Thanks for the reproducible example! The bounds are actually on the g-weights (i.e. reweighting factor = w/d), which in this case refers to the vector The problem as defined here does not actually have a solution, since margin on If what you want is the range of the final weight wCal between 3 and 38, since all initial weights are equal to 10 you can thus use:
which gives:
Hope it helps :) |
Ah! That helps a lot.
Many thanks.
Tim
From: Antoine R <[email protected]>
Sent: Tuesday, May 28, 2019 11:05 AM
To: haroine/icarus <[email protected]>
Cc: Tim Bock <[email protected]>; Author <[email protected]>
Subject: Re: [haroine/icarus] Bounds not working (#10)
Hi! Thanks for the reproducible example!
The bounds are actually on the g-weights (i.e. reweighting factor = w/d), which in this case refers to the vector wCal / data_ex2$poids
The problem as defined here does not actually have a solution, since margin on categ for example implies a constraint on total population of 230, but the min bound of 3 on the reweighting factor would mean an estimated pop total with calibrated weights of at least 3*230 = 690. What you observe here is thus a numerical aberration (icarus finds a numerical solution within the pre-set 1e-6 tolerance).
If what you want is the range of the final weight wCal between 3 and 38, since all initial weights are equal to 10 you can thus use:
bounds = c(0.3, 380)
which gives:
range(wCal)
[1] 3.96063 39.08558
Hope it helps :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#10>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ADEF6QEWUVDS7U3BYOGW2WLPXSALZANCNFSM4HPZTCQA>.
|
When I run the following, I get minimum and maximum weight values that are outside the bounds. Sorry if I've misunderstood the documentation...
library(icarus)
mar1 <- c("categ",3,80,90,60)
mar2 <- c("sexe",2,140,90,0)
mar3 <- c("service",2,100,130,0)
mar4 <- c("salaire", 0, 470000,0,0)
margins <- rbind(mar1, mar2, mar3, mar4)
wCal <- calibration(data = data_ex2,
marginMatrix = margins,
colWeights="poids",
method = "logit",
bounds = c(3, 38),
description=FALSE)
range(wCal)
The text was updated successfully, but these errors were encountered: