[R] Custom sampling method in R XXXX
dan.abner99 at gmail.com
Mon Jun 23 23:11:00 CEST 2014
I have the following situation and a good efficient way to perform
this operation in R has not come to me. Any suggestions/input are
I have a user-defined parameter (let's call it x) whose value is
selected from a set of possible values (j). Once the user selects one
of the values of j for x, then I need to map a probability
distribution to the values of j such that the middle probability of
.5385 (see probs below) is associated with the value of x and the tail
probabilities are assigned to the 2 values below x and 2 values above
x in j. Therefore, in the example below:
probabilities would be assigned to the values of j as such:
And then 1 value of j is selected based on the associated probability.
Any ideas on an efficient way to do this?
An added dimension of complexity is when the value of x is selected
near the parameter boundary of j. If x = 0, then the easiest thing I
can think of is to assign probabilities as:
However, I am open to other possibilities.
Any assistance is appreciated.
More information about the R-help