0

I have a random variable that can take 4 different values (4,8,16,32)and I would like to update it via sampling from its pdf, which is proportional to:

\begin{equation}
    \pi(\nu)\prod_{i=1}^N(\Gamma(\nu/2)(\nu/2)^{(\nu/2)})^{-1} \lambda_i^{(\nu/2 -1)} e^{-\nu\lambda_i/2}
\end{equation}
Peter O.
  • 32,158
  • 14
  • 82
  • 96
Alice
  • 99
  • 6
  • I believe you're missing an equal sign in there, and I'm sure you're missing a whole lot of explanation about the parameterization. General approach is calculate your function for the four values and sum, normalize each function by evaluation by the sum to make it a valid pdf. Then generate the CDF from the pdf, generate a U ~ uniform(0,1), and see which CDF values U falls between to determine the outcome. – pjs Jan 24 '19 at 19:28
  • Thank you for your help! I would like to know for example whether I could just update the probabilities using this formula and then sample using the updated probabilities? – Alice Jan 25 '19 at 13:35
  • I don't see why not. Your formula requires evaluating two transcendental functions, exp and gamma, but it looks like you can pre-evaluate and store the gammas. I wouldn't think rebuilding the CDF for four outcomes would be prohibitive. It would help if you defined your notation though. I'm operating on the assumption that `nu` represents your four outcomes. – pjs Jan 25 '19 at 15:30

0 Answers0