Skip to content

Instantly share code, notes, and snippets.

View junpenglao's full-sized avatar
🏠
Working from home

Junpeng Lao junpenglao

🏠
Working from home
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@junpenglao
junpenglao / brms_monotonic_compare.ipynb
Created March 1, 2018 11:28
Ordered Statistics in PyMC3
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.
@junpenglao
junpenglao / [WIP] Laplace approximation in pymc3.ipynb
Last active April 1, 2018 19:19
Laplace approximation in PyMC3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy
import theano
import theano.tensor as tt
from theano.gradient import disconnected_grad as stop_grad
x = tt.dscalar('x')
y = x ** 2
gy = tt.grad(y, x)
f = theano.function([x], gy)
@junpenglao
junpenglao / OOS_Predict_with_Missing.ipynb
Last active May 9, 2018 22:58
OOS Prediction for regression model with missing data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@junpenglao
junpenglao / Dirichlet_random_area_plot.py
Created June 8, 2018 14:18
Visualization of realization of 2D dirichlet random variable with area plot that shows uncertainty.
import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
plt.style.use('ggplot')
pmat = np.vstack([np.linspace(1, 20, 20),
np.linspace(2, 10, 20),
np.linspace(3, 5, 20)]).T
p = np.asarray([st.dirichlet.rvs(p_, 200) for p_ in pmat])
@junpenglao
junpenglao / [WIP] Bayesian GMM.ipynb
Last active October 18, 2019 11:11
Documents/Github/Human_Learning/Miscellaneous/[WIP] Bayesian GMM.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@junpenglao
junpenglao / tfp_nuts_demo.ipynb
Last active January 13, 2020 15:13
TFP_NUTS_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@junpenglao
junpenglao / mixture_tfp.ipynb
Last active October 19, 2020 13:10
mixture_tfp.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.