| from jax import random, jit | |
| import jax.numpy as jnp | |
| from jax.scipy import stats | |
| from util import ravelize_function, make_log_density | |
| __all__ = ["log_density", "log_density_vec", "init_draw_zero"] | |
| def constrain_parameters(sigma_unc, alpha, beta): |
| import polars as pl | |
| # Making data frames ------------------------------------------ | |
| # with dictionary | |
| df = pl.DataFrame({ | |
| 'name': ['foo', 'bar', 'baz'], | |
| 'bar': [0, 1, 2], | |
| 'qux': [0.0, 1.0, 2.0] | |
| }) |
| #Author: Cameron Davidson-Pilon, replicated styles from FiveThirtyEight.com | |
| # See https://www.dataorigami.net/blogs/fivethirtyeight-mpl | |
| # Modified by Nathan McIntosh to my personal tastes | |
| # Text is all very large, ideal for use in presentations | |
| lines.linewidth: 4 | |
| lines.solid_capstyle: butt | |
| legend.fancybox: true |
| # set number of cores to use fitting the model | |
| # no benefit on runtime if cores > chains which is set to 4 by default | |
| options(mc.cores = 4) | |
| # Packages ---------------------------------------------------------------- | |
| # install.packages(c("data.table", "remotes", "ggplot2")) | |
| # remotes::install_github("epiforecasts/EpiNow2") | |
| # remotes::install_github("epiforecasts/covidregionaldata") | |
| library(data.table) | |
| library(ggplot2) |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
EDIT from 2019: Hi folks. I wrote this gist for myself and some friends, and it seems like it's gotten posted somewhere that's generated some (ahem, heated) discussion. The whitespace was correct when it was posted, and since then GitHub changed how it formats (thank you @anzdaddy for suggesting a formatting workaround) honestly this is a random throwaway gist from 2015, and someone more knowledgable about this comparison should just write a proper blog post about it. If you comment here I'll hopefully see it and stick a link to it up here. Cheers. @oconnor663<pre> tags. Look at the raw text if you care about this. I'm sure someone could tell me how to fix it, but
Here's the canonical TOML example from the TOML README, and a YAML version of the same.
title = "TOML Example" |
