13.08.2022 Views

advanced-algorithmic-trading

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

67

Figure 6.5: Overlay of samples from the stochastic volatility model with the actual AMZN returns

This concludes the part of the book on Bayesian Statistics. The material provided here will

be used heavily in subsequent chapters on Time Series Analysis and Machine Learning, as many

of these models utilise Bayesian techniques within their derivation.

6.4 Full Code

# pymc3_bayes_stochastic_vol.py

import datetime

import pprint

import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import pandas_datareader as pdr

import pymc3 as pm

from pymc3.distributions.timeseries import GaussianRandomWalk

import seaborn as sns

def obtain_plot_amazon_prices_dataframe(start_date, end_date):

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!