The PyMC3 workflow

PyMC3 aims for intuitive and readable, yet powerful syntax that reflects how statisticians describe models. The modeling process generally follows these five steps:

  1. Encode a probability model by defining the following:
    1. The prior distributions that quantify knowledge and uncertainty about latent variables
    2. The likelihood function that conditions the parameters on observed data
  2.  Analyze the posterior using one of the options described in the previous section:
    1. Obtain a point estimate using MAP inference
    2. Sample from the posterior using MCMC methods
  3. Approximate the posterior using variational Bayes.
  4. Check your model using various diagnostic tools.
  5. Generate predictions.

The resulting model can be used for inference to gain detailed insights into parameter values as well as to predict outcomes for new data points.

We will illustrate this workflow using simple logistic regression (see the notebook bayesian_logistic_regression). Subsequently, we will use PyMC3 to compute and compare Bayesian Sharpe ratios, estimate dynamic pairs trading ratios, and implement Bayesian linear time series models.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
34.200.248.66