Skip to content

Instantly share code, notes, and snippets.

View bertilhatt's full-sized avatar

Bertil Hatt bertilhatt

  • London
View GitHub Profile
@rmcelreath
rmcelreath / prior_likelihood_conflict.r
Created September 11, 2023 11:29
Demonstration of how normal and student-t distributions interact in Bayesian updating
# prior - likelihood conflict
library(rethinking)
yobs <- 0
mtt <- ulam(
alist(
y ~ dstudent(2,mu,1),
mu ~ dstudent(2,10,1)
@kconner
kconner / macOS Internals.md
Last active March 22, 2024 22:58
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@tartakynov
tartakynov / fourex.py
Last active January 12, 2024 23:43
Fourier Extrapolation in Python
import numpy as np
import pylab as pl
from numpy import fft
def fourierExtrapolation(x, n_predict):
n = x.size
n_harm = 10 # number of harmonics in model
t = np.arange(0, n)
p = np.polyfit(t, x, 1) # find linear trend in x
x_notrend = x - p[0] * t # detrended x