def __init__(self, stock: 'str', event_input: 'float', idio_mult=1.0): super().__init__(stock, idio_mult) if type(event_input) is int or type(event_input) is float: self.event_input = float_to_volbeta_distribution(event_input) else: self.event_input = event_input
def __init__(self, stock: 'str', event_input: 'float', idio_mult=1.0): super().__init__(stock, idio_mult=idio_mult) if type(event_input) is int or type(event_input) is float: self.event_input = float_to_volbeta_distribution(event_input) else: self.event_input = event_input logger.info("{} {} Instantiated Successfully".format( self.stock, self.name))
from scipy.interpolate import interp1d import numpy as np import matplotlib.pyplot as plt from Distribution_Module import float_to_volbeta_distribution from paul_resources import get_histogram_from_array x = np.linspace(0, 10, num=10000, endpoint=True) y = np.sin(np.cos(-x**2 / 9.0)) + x**.3 - np.cos(x * 10)**2 f = interp1d(x, y) f2 = interp1d(x, y, kind='cubic') xnew = np.linspace(0, 10, num=10000, endpoint=True) #plt.plot(x, y, '-') #plt.plot(xnew, f(xnew), '-') #plt.plot(xnew, f2(xnew), '-') #x2 = np.linspace(0,10, num=100, endpoint=True) #y2 = np.cos(-x2**2/9.0) #plt.plot(x2, y2, 'b') #plt.legend(['Data', 'Linear', 'Cubic'], loc='best') #plt.show() dist = float_to_volbeta_distribution(.05) dist.get_histogram(10**4)