Skip to content

Instantly share code, notes, and snippets.

@MGCodesandStats
Created November 4, 2021 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MGCodesandStats/cd490a5114260428711d655abf4d4760 to your computer and use it in GitHub Desktop.
Save MGCodesandStats/cd490a5114260428711d655abf4d4760 to your computer and use it in GitHub Desktop.
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
def mode3(self):
return (np.random.pareto(3, self.length) + 1) * 3
def fact(self):
return "Sample generated in accordance with the Pareto Distribution."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment