1

In his post, one of our colleagues asked if it is possible to find the shape parameters of a $Beta(\alpha,~\beta)$ distribution given knowledge about its $\mu~(mean)$ and $variance$.

However, my question is how in R I can find shape parameters of a $Beta(\alpha,~\beta)$ distribution given only its quantiles (say, lower quantile is "$x = some~known~number$" and upper quantile is "$y = some~known~number$")?

rnorouzian
  • 3,056
  • 2
  • 16
  • 40
  • 1
    The indicated duplicate was offered in "Related" before I marked it as a duplicate, which suggests that it would have been one of the posts offered to you as potentially answering your question before you posted. – Glen_b Apr 10 '17 at 01:29
  • @Glen_b, Sorry are you sure the question you're referring to as being exactly similar to mine is answering my question, because I think that question is a bit different? To be exact that question is talking about a scaled, recentered Beta. My question is about an ordinary Beta. Could you please clarify? – rnorouzian Apr 10 '17 at 01:42
  • 1
    @parvin It solves a problem of which yours is a special case. The *very first step* of whuber's solution converts it to your standard beta problem. The rest of the answer is the actual solution to your problem. If it completely solves the thing you asked about (it does -- indeed if you put L=0, U=1 you can follow all the steps there) then it's a duplicate. – Glen_b Apr 10 '17 at 02:12
  • As far as I can see, it's fully answered there. Indeed once it's marked as a duplicate, if I *had* any answer, I'm supposed to post it in the other thread, not here (indeed I can't post one here at all). My short answer there would consist of "read whuber's excellent answer, which deals with this relatively\* complicated problem in detail". \*(compared to doing it from moments say)... such an answer would rightly be deleted. If you have a *specific* question about that post you can post a new question and link to that one, or if you seek a small clarification, you can post a comment and ask. – Glen_b Apr 10 '17 at 02:25
  • 1. whuber's answer is his text. His code shows two particular examples (note especially the comment `a good guess is useful here`) but if you just try to turn that into a general solution (say by trying to wrap a function around it) you'll potentially have problems (as the text explains and one of the examples should help make clear). 2. The examples his code shows are the standard beta case (note the `lower=0, upper=1` in the argument list of the call to `nlm`; that's because his examples are on that interval). It's not clear what more you seek. Try running his code, perhaps – Glen_b Apr 10 '17 at 02:43
  • You will likely benefit a great deal from studying his code carefully and learning from it; there's a reason for everything there. It's an exemplar of the sort of code a good practicing statistician will write at various times, it's quite concise but very clear, the sort of thing you can come back to a year later and comprehend again with very little effort. Even though I write a lot of code, generally I dislike trying to read other people's code (even my own at times)... but whuber's code there is actively pleasurable to read. – Glen_b Apr 10 '17 at 02:52
  • To understand what it does, start down in the bottom section "solve two problems". The `for` loop simply loops over the two examples, so inside the loop is what is needed to solve one problem. If you want to try different problems, change the list that the `for` loops over. Above that section are the workhorse functions that are needed in order for the optimizer `nlm` to find parameter estimates; their function should be obvious, but if not, you can try asking in a comment (failing that, a more extended question about the code would be best in a StackOverflow post to ask about what it's doing) – Glen_b Apr 10 '17 at 03:04
  • Note that the alpha and beta are set immediately *above* the `for` loop. Inside the structure of the for call itself are the two quantiles (x-values). The p's that go with those x's (the amount of the distribution to their left) are evaluated at the first step inside the loop – Glen_b Apr 10 '17 at 03:50
  • 1
    @Glen_b, thank you got you, ok, yes the whole point is that to provide some specified quantiles, and get the required alpha and beta. This is really a need to specify a beta prior. – rnorouzian Apr 10 '17 at 04:22
  • @parvin please don't nag people to look at your questions via comments. We get about 200 questions a day. Imagine the state of our site if every week 1400 people each posted two such messages (as you did). In a year we'd have 150000 comments all begging for attention. Instead, just make your questions as clear and interesting as you can. – Glen_b Apr 11 '17 at 05:17
  • @Glen_b, yes sir! Honestly spent 2.5 hrs on that question. But you're right. Thank you! – rnorouzian Apr 11 '17 at 05:28
  • I haven't even had time to look at more than a couple of posts today; I'm sure someone will look at it soon. – Glen_b Apr 11 '17 at 06:09
  • Oh sure, thank you so much. Just am curious about the answer. I have heard very unclear answers before posting. Anyways, thank you. – rnorouzian Apr 11 '17 at 06:12

0 Answers0