04pallav
9/11/2017 - 10:21 PM

Create pdf from a series

Create pdf from a series

from scipy.stats.kde import gaussian_kde
from numpy import linspace
# input data
data = train.loss
# data =randn(10000)
# this create the kernel, given an array it will estimate the probability over that values
kde = gaussian_kde( data )
# these are the values over wich your kernel will be evaluated
dist_space = linspace( min(data), max(data), 100 )
# plot the results
plt.figure(figsize=(10,10), dpi=80)
plt.plot( dist_space, kde(dist_space) )

train.loss.describe()  ### use this to see the stat description of series