Back to Community
pymc3 - will we be allowed to import into research?

import pymc3

InputRejected:
Importing pymc3 raised an ImportError. Did you mean to import pytz instead?

will we be allowed to import into research?

7 responses

some reading if anyone interested

Predicting future returns of trading algorithms: Bayesian cone

Probabilistic programming in Python

Examples

Howto
Posterior Predictive Checks
Comparison between PPC and other model evaluation methods.
Prediction
Mean predicted values plus error bars to give sense of uncertainty in prediction
How to debug a model
LKJ Prior for fitting a Multivariate Normal Model
Applied
Bayesian Estimation Supersedes the T-Test
The Problem
Example: Drug trial evaluation
References
Stochastic Volatility model
Build Model
Fit Model
References
A Hierarchical model for Rugby prediction
Motivation
What do we want to infer?
What do we want?
What assumptions do we know for our ‘generative story’?
The model.
Building of the model
Results
Covariates
Bayesian Survival Analysis
A crash course in survival analysis
Bayesian proportional hazards model
Time varying effects
Gaussian Process (GP) smoothing
Let’s try a linear regression first
Linear regression model recap
Gaussian Process smoothing model
Let’s describe the above GP-smoothing model in PyMC3
Exploring different levels of smoothing
Smoothing “to the limits”
Interactive smoothing
GLM
GLM: Linear regression
Linear Regression
Probabilistic Reformulation
Bayesian GLMs in PyMC3
Generating data
Estimating the model
Analyzing the model
Summary
Further reading
GLM: Robust Linear Regression
Robust Regression
Summary
GLM: Robust Regression with Outlier Detection
Setup
Load and Prepare Data
Create Conventional OLS Model
Create Robust Model: Student-T Method
Create Robust Model with Outliers: Hogg Method
Declare Outliers and Compare Plots
Posterior Prediction Plots for OLS vs StudentT vs SignalNoise
GLM: Model Selection
Setup
Local Functions
Generate Toy Datasets
Interactively Draft Data
Create Datasets for Modelling
Scatterplot against model line
Standardize
Create ranges for later ylim xim
Demonstrate Simple Linear Model
Define model using ordinary pymc3 method
View Traces after burn-in
Define model using pymc3 GLM method
View Traces after burn-in
Create Higher-Order Linear Models
Create and run polynomial models
A really bad method for model selection: compare likelihoods
View posterior predictive fit
Compare Deviance Information Criterion [DIC]
Compare Watanabe - Akaike Information Criterion [WAIC]
TODO
K-Fold Cross Validation and/or Leave-One-Out (LOO)
Left for future development - should be easy enough
Bayes Factor
Rolling Regression
Rolling regression
Analysis of results
GLM: Hierarchical Linear Regression
The data set
The Models
Pooling of measurements
Unpooled measurements: separate regressions
Partial pooling: Hierarchical Regression aka, the best of both worlds
Probabilistic Programming
Unpooled/non-hierarchical model
Hierarchical Model
Posterior Predictive Check
The Root Mean Square Deviation
Shrinkage
Connections to Frequentist statistics
Summary
References
Acknowledgements
GLM: Poisson Regression
A minimal reproducable example of poisson regression to predict counts using dummy data.
Contents
Package Requirements (shown as a conda-env YAML):
Setup
Local Functions
Generate Data
Poisson Regression
Create Model
Sample Model
View Diagnostics
Transform coeffs and recover theta values
2. Alternative method, using pymc.glm
Create Model
Sample Model
View Traces
Transform coeffs
Hierarchical Partial Pooling
Data
Approach
Mixture Models
Gaussian Mixture Model
Full trace
After convergence
Sampling of cluster for individual data point
Marginalized Gaussian Mixture Model
Gaussian Mixture Model with ADVI
Dirichlet process mixtures for density estimation
Dirichlet processes
Dirichlet process mixtures
ADVI
GLM: Hierarchical Linear Regression with ADVI
Posterior Predictive Check
The Root Mean Square Deviation
GLM: Mini-batch ADVI on hierarchical regression model
Automatic autoencoding variational Bayes for latent dirichlet allocation with PyMC3
Dataset
Log-likelihood of documents for LDA
LDA model
Mini-batch
Encoder
AEVB with ADVI
Extraction of characteristic words of topics based on posterior samples
Predictive distribution
Summary
References
Variational Inference: Bayesian Neural Networks
Current trends in Machine Learning
Probabilistic Programming at scale
Deep Learning
Bridging Deep Learning and Probabilistic Programming
Bayesian Neural Networks in PyMC3
Generating data
Model specification
Variational Inference: Scaling model complexity
Lets look at what the classifier has learned
Probability surface
Uncertainty in predicted value
Mini-batch ADVI: Scaling data size
Summary
Next steps
Acknowledgements
Convolutional variational autoencoder with PyMC3 and Keras
Load images
Use Keras
Encoder and decoder
Generative model
Inference
Results

Thanks for sharing this Umar.

May I second Umar's request, adding pymc3 to QTP?

+1 for PyMC3.

+1

+1 I Have been learning about pymc3, and thought it would be a great addition to quantopian as well.

I'm a big fan of Probabilistic Modeling, I've been going to the meetups here in bay area.

Probably won't happen at the rate of product development. I ended building out my own research environment w/ GPU support, and my own live trading interface w/ IB.

+1