Git Product home page Git Product logo

optweight's People

Contributors

ngreifer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

guhjy mrubinst757

optweight's Issues

Convergence issues with larger datasets

I ran into an convergence issue trying SBW on a dataset of mine, which seems size related, once ≥N samples (dependent on the treatment distribution?), optweight fails to converge.

ow_test.zip

library(optweight)
library(WeightIt)

testdf = readRDS("ow_test.rds")

optweight(trt ~ age, data=testdf, estimand = "ATE")           # fails
optweight(trt ~ age, data=testdf[1:16765,], estimand = "ATE") # runs
optweight(trt ~ age, data=testdf[1:16766,], estimand = "ATE") # fails
weightit(trt ~ age, data=testdf, method = "ebal", estimand = "ATE")

data("lalonde", package = "cobalt")
set.seed(123)
lalonde_dup = lalonde[sample(nrow(lalonde), 50000, replace = T),]
optweight(treat ~ age + educ + married + nodegree + re74,             # original  
          data = lalonde, tols = .01, estimand = "ATE")               
optweight(treat ~ age + educ + married + nodegree + re74,             # fails
          data = lalonde_dup, tols = .01, estimand = "ATE")           
optweight(treat ~ age + educ + married + nodegree + re74,             # success
          data = lalonde_dup[1:14339,], tols = .01, estimand = "ATE") 
optweight(treat ~ age + educ + married + nodegree + re74,             # fails
          data = lalonde_dup[1:14340,], tols = .01, estimand = "ATE") 
optweight(treat ~ age,                                                # continues to fail despite simplification
          data = lalonde_dup[1:14340,], tols = .01, estimand = "ATE") 
> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] WeightIt_0.14.2 optweight_0.2.5

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7       rstudioapi_0.14  magrittr_2.0.1   cobalt_4.5.1     tidyselect_1.1.1 munsell_0.5.0    colorspace_2.0-3 lattice_0.20-44 
 [9] R6_2.5.1         rlang_1.1.1      fansi_0.5.0      dplyr_1.0.7      tools_4.0.5      grid_4.0.5       gtable_0.3.1     osqp_0.6.0.8    
[17] utf8_1.2.2       cli_3.4.1        ellipsis_0.3.2   tibble_3.1.4     lifecycle_1.0.3  crayon_1.4.1     Matrix_1.3-4     purrr_0.3.4     
[25] ggplot2_3.4.2    vctrs_0.6.3      glue_1.4.2       compiler_4.0.5   pillar_1.6.2     chk_0.9.0        backports_1.4.1  generics_0.1.0  
[33] scales_1.2.1     pkgconfig_2.0.3 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.