okama.Portfolio.plot_hist_fit

Portfolio.plot_hist_fit(distr='norm', bins=None)

Plot historical distribution histogram for ptrtfolio monthly rate of return time series and theoretical PDF (Probability Distribution Function).

Can be used with Normal, Lognormal and Stident’s T distributions.

Parameters:
distr{‘norm’, ‘lognorm’, ‘t’}, default ‘norm’

The name of a distribution to fit. ‘norm’ - for normal distribution. ‘lognorm’ - for lognormal distribution. ‘t’ - for Student’s T distribution.

Examples

>>> import matplotlib.pyplot as plt
>>> pf = ok.Portfolio(['SP500TR.INDX'])
>>> pf.plot_hist_fit(distr='norm')
>>> plt.show()
../_images/okama-Portfolio-plot_hist_fit-1.png