Skip to content

Instantly share code, notes, and snippets.

View tpogden's full-sized avatar

Thomas Ogden tpogden

View GitHub Profile
@tpogden
tpogden / README.md
Last active August 29, 2015 13:57
Highest Peaks of EU States

A bar chart of the highest points of each EU member state. Note: I've ignored peaks that aren't on the European continent.

Source: Wikipedia.

@tpogden
tpogden / README.md
Last active August 29, 2015 13:57
Building a Normal Distribution Histogram

A randomly-generated normal distribution with a mean of 0 and a standard deviation of 3 on an ordinal x-axis. The histogram will add one datapoint at a time until it has reached 100 datapoints.

@tpogden
tpogden / README.md
Last active August 29, 2015 14:08
Random Scatter

A set of 100 points are given a new uniform random distribution every 5 seconds.

@tpogden
tpogden / README.md
Last active August 29, 2015 14:08
Least Squares Fit

Fits a straight line to data using the Least Squares method.

"Least squares" means that the overall solution minimizes the sum of the squares of the errors made in the results of every single equation.

Least squares function by Ben van Dyke.

@tpogden
tpogden / README.md
Last active April 4, 2016 17:45
Hermite Polynomials

Plots the first ten Hermite polynomials (physicists' definition), defined using the recursion relation.

$$ H_{n+1}(x) = 2x H_n(x) - 2 (n-1) H_{n-2}(x) $$

@tpogden
tpogden / README.md
Last active April 3, 2016 18:38
Monte Carlo Integration 1

Monte Carlo integration of the function $f(x) = x^2$ on the interval $\left[ 0, 1 \right]$ on $\mathbb{R}$. The correct result is $1/3$. How close is the numerically computed result?

We sample $N = 1000$ points on the plane $(x,y) \in ([0,1], [0,1])$ and define an acceptance function

$$ A(x,y) = \begin{cases} 1 & \text{if} ~ y \leq f(x) \

@tpogden
tpogden / README.md
Last active April 4, 2016 18:45
Otimes Icon
@tpogden
tpogden / .block
Last active January 26, 2017 18:41
Sieve of Eratosthenes
height: 944
border: no
@tpogden
tpogden / run_notebooks.py
Last active February 7, 2023 14:02
Run a Set of Jupyter Notebooks from the Command Line
# ! python
# coding: utf-8
import os
import argparse
import glob
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor
from nbconvert.preprocessors.execute import CellExecutionError
0.85 17.45 2
0.75 15.6 2
3.3 15.45 2
5.25 14.2 2
4.9 15.65 2
5.35 15.85 2
5.1 17.9 2
4.6 18.25 2
4.05 18.75 2
3.4 19.7 2