Skip to content

Instantly share code, notes, and snippets.

View aflaxman's full-sized avatar

Abraham Flaxman aflaxman

View GitHub Profile
@aflaxman
aflaxman / 2024_01_04a_vph_dementia_dismod_ipd_sim.ipynb
Created January 5, 2024 17:54
Vivarium Public Health model for Dementia in Singapore
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aflaxman
aflaxman / flipped_interaction_for_python.md
Last active December 14, 2023 03:22
Prompt for a GPT

Hi ChatGPT! In this conversation, I would like you help me write code. Please ask me clarifying questions about the coding task to break the problem down into managable chunks. If not otherwise specified, please code in Python. When you have sufficient information then you should please write the code for me, using best practices for function and variable names, and documentation.

Please also include some simple tests when appropriate.

Please do not try to solve a complex problem by yourself.

@aflaxman
aflaxman / 2022_08_25c_re_poisson_model_w_offset_in_bambi.ipynb
Created August 25, 2022 19:14
Random Effects Poisson Model with Offset in Bambi
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np, pandas as pd, matplotlib.pyplot as plt
from collections import namedtuple
from jax import random, lax
from jax.flatten_util import ravel_pytree
import jax.numpy as jnp
import numpyro
import numpyro.distributions as dist
from numpyro.infer import MCMC, util, init_to_sample
from numpyro.infer.mcmc import MCMCKernel
from collections import namedtuple
from jax import random
from jax.flatten_util import ravel_pytree
import jax.numpy as jnp
import numpyro
import numpyro.distributions as dist
from numpyro.infer import MCMC, util
from numpyro.infer.mcmc import MCMCKernel
MetState = namedtuple("MetState", ["z", "rng_key"])
from collections import namedtuple
from jax import random
from jax.flatten_util import ravel_pytree
import jax.numpy as jnp
import numpyro
import numpyro.distributions as dist
from numpyro.infer import MCMC, util
from numpyro.infer.mcmc import MCMCKernel
MetState = namedtuple("MetState", ["z", "rng_key"]) # does it matter if it is called z or u?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.