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
@junpenglao
junpenglao / Check_rLKJCorr.py
Last active August 3, 2017 06:22
Random Correlation matrix using the algorithm in LKJ 2009 (vine method based on a C-vine)
"""
Random Correlation matrix (LKJ 2009) output checking
Created on Wed Aug 2 09:09:02 2017
@author: junpenglao
"""
import numpy as np
from scipy import stats
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@junpenglao
junpenglao / OOS_Predict_with_Missing.ipynb
Last active May 9, 2018 22:58
OOS Prediction for regression model with missing data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@junpenglao
junpenglao / Mixture_discourse.ipynb
Created November 9, 2017 12:14
mixture regression
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@junpenglao
junpenglao / Marginal Likelihood in Python.ipynb
Last active June 24, 2024 00:28
Marginal Likelihood in Python and PyMC3, based on the paper reading of "A Tutorial on Bridge Sampling"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@junpenglao
junpenglao / HMC_in_pyro.ipynb
Last active January 23, 2018 17:18
Testing the HMC in Pyro (recently merged to dev branch)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
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)