Hi,
I have a case in which I want to draw a random probability using beta distribution. I receive a value X between 1 and 5, and I want the probability becomes high if the value is very close to 1 or very close to 5. I thought to use beta distribution Ushaped with beta parameters a=b=0.5, as you can see in the following graph.
I got some help to draw it in R, here is the implementation in python:
I have a case in which I want to draw a random probability using beta distribution. I receive a value X between 1 and 5, and I want the probability becomes high if the value is very close to 1 or very close to 5. I thought to use beta distribution Ushaped with beta parameters a=b=0.5, as you can see in the following graph.
I got some help to draw it in R, here is the implementation in python:
Python:
import numpy as np
from scipy.stats import beta
import matplotlib.pyplot as plt
x = np.linspace(1,5,1000)
y= 1/4 * beta.pdf((x1)/4,a=0.5,b=0.5)
plt.ylim(0,1)
plt.plot(x,y)
Attachments

10.1 KB Views: 1
Last edited: