Yes, there is. I wrote codes which give you the same result of pandas autocorrelation_plot() method.
Here is the code:
from bokeh.layouts import column
from bokeh.plotting import figure, curdoc
import timeseries_model_creator # to get data
import numpy as np
TimeSeriesModelCreator = timeseries_model_creator.TimeSeriesModelCreator()
series = TimeSeriesModelCreator.read_csv() # time series object
def get_autocorrelation_plot_params(series):
n = len(series)
data = np.asarray(series)
mean = np.mean(data)
c0 = np.sum((data - mean) ** 2) / float(n)
def r(h):
return ((data[:n - h] - mean) *
(data[h:] - mean)).sum() / float(n) / c0
x = np.arange(n) + 1
y = map(r, x)
print "x : ", x, " y : ", y
z95 = 1.959963984540054
z99 = 2.5758293035489004
return n, x, y, z95, z99
n, x, y, z95, z99 = get_autocorrelation_plot_params(series)
auto_correlation_plot2 = figure(title='Time Series Auto-Correlation', plot_width=1000,
plot_height=500, x_axis_label="Lag", y_axis_label="Autocorrelation")
auto_correlation_plot2.line(x, y=z99 / np.sqrt(n), line_dash='dashed', line_color='grey')
auto_correlation_plot2.line(x, y=z95 / np.sqrt(n), line_color='grey')
auto_correlation_plot2.line(x, y=0.0, line_color='black')
auto_correlation_plot2.line(x, y=-z95 / np.sqrt(n), line_color='grey')
auto_correlation_plot2.line(x, y=-z99 / np.sqrt(n), line_dash='dashed', line_color='grey')
auto_correlation_plot2.line(x, y, line_width=2)
auto_correlation_plot2.circle(x, y, fill_color="white", size=8) # optional
curdoc().add_root(column(auto_correlation_plot2))
Here is the bokeh plot:
