I want to generate 1 Million and 10 Million data points in the range (0.0001,0.03) using a beta distribution with a=2.2 and b=1. Thanks in advance!
I tried this:
from scipy.stats import beta
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
a, b = 2.2, 1
#Generated pdf of required range
x = np.linspace(0.0001, 0.03, 100)
ax.plot(x, beta.pdf(x, a, b),
'k-', lw=5, alpha=0.6, label='beta pdf')
r = beta.rvs(a, b, size=1000) #Generating values
print(r)
The values in 'r' are not in the range (0.0001,0.03).