haroine / icarus Goto Github PK
View Code? Open in Web Editor NEWA package with useful functions for calibration and reweighting in survey sampling
A package with useful functions for calibration and reweighting in survey sampling
The idea is to change the recommended margin input method to something like:
marginList <- list(
"categ" = c(0.35, 0.4, 0.25),
"sexe" = c(0.60, 0.40),
"service" = c(0.45, 0.55),
"salaire" = 470000
)
Add tests with the list method, with categorical and continuous variables
Modify addMargin
marginMatrix becomes an ambiguous parameter name: consider changing it (but ensure retrocompatibility!)
Change recommended way of integrating margins in the docs
Thanks to Toby Hocking for the suggestion!
Following the linearization formulas of Dell et. al: http://www.crest.fr/ckfinder/userfiles/files/Pageperso/xdhault/doc_JMS.pdf, Icarus could support calibration on non-linear totals such as quantiles, Gini indices, etc.
Due to the approximations, we would have to come up with an iterative procedure that would check that the final estimates correspond to the true value.
Some functions of the gustave package https://github.com/martinchevalier/gustave could be reused
Create a function so that creating a margin table would not require the actual creation of a matrix to the right format.
Bonjour,
Une question est il possible dans Icarus de créer de nouvelles valeurs de pondération à partir de zéro ?
Je veux dire par là ne pas avoir de pondération a priori ?
English version below :
Hi,
Just a litle ask, : Is it possible to create ponderation weight from scratch in icarus ?
Change all French variable names in examples and datasets to English
Hi, I need to perform a calibration using margins on a dataset of observations.
Now this operation is performed using the macro CALMAR2 in SAS, I tried using the Icarus package but the algorithm doesn't converge.
I checked all the input parameters and they are the same that I use in SAS, with the 'linear' method the algorithm converges but with the raking no.
q_k is a already a parameter of the (private) calibAlgorithm function. It should be added in calibration and properly tested so it can be used in production.
Return a list instead and suggest in the docs to use operator %<-% to facilitate multiple assignment of returned calibrationMatrix and marginMatrix.
Be careful to not deprecate the side effects functionality too fast.
As of version 0.2.0, calibration only returns a column of weights, so colCalibratedWeights should not be used as a parameter anymore.
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)
Bonjour,
Nous avons un problème de convergence avec un nombre assez important de contraintes (environ 800-900: 238*17).
Les résultats de la fonction calibration ont l'air assez cohérent si ce n'est pour une des strates (celle avec 17 options) où l'on obtient:
Lorsque nous utiliser la méthode avec pénalité en relâchant les contraintes sur cette strate étrange, nous obtenons rigoureusement le même résultat.
Nous ne parvenons pas à en déterminer la cause.
Pourtant la convergence a l'air bonne à plusieurs égards. Centrée autour de 1 avec des margins matrix avant-après très similaires.
Auriez-vous un avis sur notre problème?
Merci d'avance.
Currently, implementation of min bounds calibration is purely R and (relying on slam's sparse matrices and Rglpk).
Implementing the algorithm in C++ could:
Percentages in Icarus have now to be entered with a sum equal to 1 (e.g. "0.4 - 0.2 - 0.4"), whereas in Calmar and Calmar 2, percentages sum have to be equal to 100 (e.g. "40 - 20 - 40").
Icarus should support both input types as long as parameter pct is set to TRUE.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.