In: Statistics and Probability
If a random variable X has a beta distribution, its probability density function is
fX (x) = 1 xα−1(1 − x)β−1 B(α,β)
for x between 0 and 1 inclusive. The pdf is zero outside of [0,1]. The B() in the denominator is the beta function, given by beta(a,b) in R.
Write your own version of dbeta() using the beta pdf formula given above. Call your function mydbeta(). Your function can be simpler than dbeta(): use only three arguments (x, shape1, and shape2) and don’t bother with ncp or log.
Use your function mydbeta() for this part. Experiment with different values of α and β and plot the resulting beta pdf to answer the following questions. The parameters α and β have to be greater than zero. Otherwise there’s no restriction. In R, plot 3 pdf’s for each one.
1. What values for α and β produce a pdf which is uniform on [0,1]?
2. What relationship between α and β produces a symmetric pdf?
4. a) What values for α and β produce a triangular pdf?
b) How should I choose α and β if I want a big spike at x = .5, and 0 everywhere
else?
NOTE::: I HOPE THIS ANSWER IS HELPFULL TO YOU....*** PLEASE SUPPORT ME WITH YOUR RATING....THANK YOU....