Question: import numpy as np import matplotlib.pyplot as plt # Parameters alpha = 2 beta = 4 # Inverse CDF ( quantile function ) def weibull
import numpy as np
import matplotlib.pyplot as plt
# Parameters
alpha
beta
# Inverse CDF quantile function
def weibullinvu alpha, beta:
return alpha nplog u beta
# Generate random variates
u nprandom.uniform
x weibullinvu alpha, beta
# Plot histogram and density curve
plthistx bins densityTrue, alpha colorg
# Plot the PDF
xmin, xmax pltxlim
x nplinspacexmin xmax,
p beta alphax alphabeta npexpx alphabeta
pltplotx pk linewidth
pltshow
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
