Code Monkey home page Code Monkey logo

beyond-borders's Introduction

Hi! I'm Adam, a Bayesian statistician primarily working as a contractor with the Center for Forecasting and Outbreak Analytics at the CDC. Previously, I completed my PhD in statistics at Imperial College London. For more information, and my blog, see athowes.github.io. To give an idea about my work, see:

Repository Description
epidist An R package for estimating the time between events with interval censoring and right truncation
thesis My thesis, "Bayesian spatio-temporal methods for small-area estimation of HIV indicators", supervised by Seth Flaxman (Oxford, CS) and Jeff Eaton (Imperial, DIDE; Harvard, CCDD)
beyond-borders Evaluating the suitability of spatial adjacency for small-area estimation (arealutils)
multi-agyw Estimating HIV risk group proportions with a multinomial spatio-temporal model (multi.utils, UNAIDS)
naomi-aghq Improving approximate Bayesian inference methods for extended latent Gaussian models (inf.utils)
exp-growth Time-series methods for disease-agnostic metagenomic environmental threat detection
  • I'm always looking to improve at writing clear, concise, efficient, reproducible code. Any suggestions, let me know! I predominantly program in R. Over time, I'd like to become multilinual by learning Python (and maybe Julia?): advice welcome.
  • I'm currently reading: Trees, maps, and theorems, The Effective Manager, and miscellaneous resources about technical management, see reading.
  • You may be interested in these resources I've found useful, or what I'm learning about via tutorial.

beyond-borders's People

Contributors

athowes avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

theorashid

beyond-borders's Issues

Determine effect of geometry irregularity

#' For IK simulated data, what's the difference between Besag, FCK and FIK over the different geometries?
irregularity_effect <- df_rho %>%
  filter(sim_model == "IK", inf_model %in% c("Besag", "FCK", "FIK")) %>%
  group_by(geometry) %>%
  mutate(crps = 1000 * crps_mean,
         crps_min = min(crps),
         diff = crps - crps_min) %>%
  select(inf_model, diff)

# FCK versus best (FIK)
irregularity_effect %>% filter(inf_model == "FCK") %>% mutate_if(is.numeric, round, 1)

# Besag versus best (FIK)
irregularity_effect %>% filter(inf_model == "Besag") %>% mutate_if(is.numeric, round, 1)

Need to project before using hexagonal sampling in `cv_fik-inla`

[1] "Begin LOO cross-valdiation of CIV2017PHIA"
[ failed     ]  2022-02-20 11:00:05
[ elapsed    ]  Failed report in 0.2224343 secs
Error in st_poly_sample(x, size = size, ..., type = type, by_polygon = by_polygon) : 
  hexagonal sampling on geographic coordinates not supported; consider projecting first
In addition: Warning message:
 Error in st_poly_sample(x, size = size, ..., type = type, by_polygon = by_polygon) : 
  hexagonal sampling on geographic coordinates not supported; consider projecting first 

Both operands should be units objects in `cv_fck-inla`

[1] "Begin LOO cross-valdiation of CIV2017PHIA"
[ failed     ]  2022-02-20 10:58:47
[ elapsed    ]  Failed report in 0.2870765 secs
Error in Ops.units(m, 1e-08) : 
  both operands of the expression should be "units" objects
In addition: Warning messages:
1: `progress_estimated()` was deprecated in dplyr 1.0.0. 
2: In st_centroid.sf(sf) :
  st_centroid assumes attributes are constant over geometries of x
3: In st_centroid.sfc(st_geometry(x), of_largest_polygon = of_largest_polygon) :
 
 Error in Ops.units(m, 1e-08) : 
  both operands of the expression should be "units" objects 

Option to fix variance parameter

Jeff mentioned that it's unlikely that the variance parameter can be recovered in some of the vignette geometries (they have three areas). Add an option in bsae to fix this parameter to the correct value (oracle) then redo the inference with this option set here.

Some uncertainty here as to whether this benefits some of the methods more than others.

Investiate urban and rural for HIV

#' Largest five districts by population according to Wikipedia
big5 <- list(
  # https://en.wikipedia.org/wiki/Regions_of_Ivory_Coast
  "Cote d'Ivoire" = c("Abidjan", "Lagunes", "Woroba", "Savanes", "Lacs"),
  # https://en.wikipedia.org/wiki/Districts_of_Malawi
  "Malawi" = c("Lilongwe", "Blantyre", "Mzimba", "Mangochi", "Zomba"),
  # https://en.wikipedia.org/wiki/Districts_of_Tanzania
  "Tanzania" = c("Temeke", "Kinondoni", "Ilala", "Geita", "Sengerema"),
  # https://en.wikipedia.org/wiki/Districts_of_Zimbabwe
  "Zimbabwe" = c("Harare", "Shurugwi", "Bulawayo", "Mutare", "Gokwe South")
)

Look at the score cloropleths? Score by some measure of urbanicity?

Sort out the Tanzania islands issue from last time

Remove islands?

  nb <- sf_to_nb(tz) # Neighbourhood list
  comp <- spdep::n.comp.nb(nb) # Connected components
  table(comp$comp.id) # The number of districts in each component
  is_mainland <- comp$comp.id == 1
  tz_no_islands <- tz[is_mainland, ] # Only those on the mainland
  tz_no_islands$survey_id <- "TZ2012AIS-no-islands" # Change the ID so that fit_id works

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.