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 relationship between α and β produces a pdf which is skewed to the right?
2. What values for α and β produce a pdf which is bell-shaped? It should look close to normal.
3. Find values for α and β which produce a pdf like a concave bowl. (Concave means curved like a frown. Curved like a smile is convex.)
Get Answers For Free
Most questions answered within 1 hours.