Created
May 25, 2022 14:52
-
-
Save rahulbhadani/3f62b0ae49cc55cbb31c5f0160b1a6a6 to your computer and use it in GitHub Desktop.
Y = X^3 where X~U[0, 2]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as s | |
import matplotlib as mpl | |
import pyplot_themes as themes | |
themes.theme_solarized(scheme="dark", grid=False, ticks=False,) | |
mpl.rcParams['font.family'] = 'Serif' | |
from scipy.stats import rv_continuous | |
class YCube(rv_continuous): | |
"YCube Power distribution" | |
def _pdf(self, x): | |
y = 0 | |
if (x < (self.a)): | |
y = 0 | |
elif (x > (self.b)): | |
y = 0 | |
else: | |
y= (1.0/6.0)*(x**(-2.0/3.0)) | |
return y | |
P = YCube(name='pareto', a= 0, b =8) | |
B = P.rvs(size = 10000) | |
s.distplot(B) | |
plt.xlabel('$y$', color = '#DAD6D6') | |
plt.ylabel('f(y)', color = '#DAD6D6') | |
plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment