Can we use Base R to find the 95% of the area under a curve?
问题 Using Base R, I was wondering if I could determine the 95% area under the curve denoted as posterior below? More specifically, I want to move from the mode (the green dashed line) toward the tails and then stop when I have covered 95% of the curve area. Desired are the x-axis values that are the limits of this 95% area as shown in the picture below? prior = function(x) dbeta(x, 15.566, 7.051) likelihood = function(x) dbinom(55, 100, x) posterior = function(x) prior(x)*likelihood(x) mode =