Skip to content

Instantly share code, notes, and snippets.

View MGCodesandStats's full-sized avatar

Michael Grogan MGCodesandStats

View GitHub Profile
MarketSegment Average - ADR
Complementary 3.65
Corporate 51.56
Direct 111.67
Groups 66.44
Offline TA/TO 74.66
Online TA 113.43
Total Result 94.95
@MGCodesandStats
MGCodesandStats / binomial_class_polymorphism
Created November 4, 2021 14:24
binomial class polymorphism
class Binomial(Probability):
def __init__(self, length):
super().__init__("Binomial")
self.length = length
def binomial5(self):
return np.sum((np.random.binomial(9, 0.05, self.length) == 0))/self.length
def binomial10(self):
return np.sum((np.random.binomial(9, 0.1, self.length) == 0))/self.length
@MGCodesandStats
MGCodesandStats / pareto_class_polymorphism
Created November 4, 2021 14:40
pareto class polymorphism
class Pareto(Probability):
def __init__(self, length):
super().__init__("Pareto")
self.length = length
def mode1(self):
return (np.random.pareto(3, self.length) + 1) * 1
def mode2(self):
return (np.random.pareto(3, self.length) + 1) * 2