Skip to content

Instantly share code, notes, and snippets.

View dmbates's full-sized avatar

Douglas Bates dmbates

View GitHub Profile
@dmbates
dmbates / SimpleGibbs.md
Last active May 27, 2021 01:37
Simple Gibbs sampler in Julia

The Gibbs sampler discussed on Darren Wilkinson's blog and also on Dirk Eddelbuettel's blog has been implemented in several languages, the first of which was R.

The task is to create a Gibbs sampler for the unscaled density

 f(x,y) = x x^2 \exp(-xy^2 - y^2 + 2y - 4x)

using the conditional distributions

 x|y \sim Gamma(3, y^2 +4)

y|x \sim Normal(\frac{1}{1+x}, \frac{1}{2(1+x)})

@dmbates
dmbates / Issue611.ipynb
Created May 3, 2022 18:04
Notebook related to MixedModels.jl issue 611
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dmbates
dmbates / benchmark.jl
Created June 4, 2022 13:33
Code for benchmarking sort!(unique!(df)) versus sort!(df) on a real-world example
using CSV, DataFrames, Downloads, Tar
datadir = "biofast-data-v1"
tarball = "$datadir.tar.gz"
if !isfile(tarball)
dataurl = joinpath(
"https://github.com/lh3/biofast/releases/download",
datadir,
tarball,
)
@dmbates
dmbates / RCall_IJulia_ggplot2.qmd
Last active July 2, 2022 11:42
Using ggplot2 in IJulia notebook through RCall
---
jupyter: julia-1.7
---
```{julia}
using RCall
```
```{julia}
RCall.ijulia_setdevice(MIME("image/svg+xml"))
@dmbates
dmbates / JuliaGitPullRequest.md
Created May 16, 2012 16:49
Setting up git for creating pull requests to JuliaLang

These notes are based on Patrick O'Leary's video that he kindly created when I was wingeing about problems with git. It is best to watch the video first then go back through these notes to recall the steps.

Create a clone of the JuliaLang repository

git clone git://github.com/JuliaLang/julia.git

or

git clone git://github.com/JuliaLang/julia.git myjulia
@dmbates
dmbates / warning.ipynb
Created April 26, 2024 14:28
Use of `warning: false` with QuartoNotebookRunner
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.