I am going through an old research paper and I am stuck in one area of the coding. I'll spare you with most of the details but the function I want to simulate from is a complicated multivariate beta function that looks like:


So clearly, I've already defined other functions. I know that I need to input rating and R. However, I would like perform a monte carlo simulation to obtain vectors of x.

Any help would be greatly appreciated.

  • $\begingroup$ Welcome, Jim! Do you perhaps mean mvBeta[rating_,x_,R_]:=densityProduct[rating,x]*mvnCopula[copulaInput[rating,x],R], noting this: mathematica.stackexchange.com/a/18487/8 ? And what sort of input is x? Random real numbers? Some other distirbution? $\endgroup$
    – Verbeia
    Commented Dec 2, 2014 at 5:25
  • $\begingroup$ This is just a guess without more information, but something using Map (/@) is probably what you want: mvBeta[rating,#,r]&/@ xvector. $\endgroup$
    – Verbeia
    Commented Dec 2, 2014 at 5:31
  • $\begingroup$ input for x is random real numbers in the[0,1] interval. I am not sure how the map is going to work because I do not have a xvector. Rather, I want to simulate this vector just given rating and R $\endgroup$
    – Jim
    Commented Dec 2, 2014 at 5:58
  • $\begingroup$ xvector = RandomReal[{0,1},100] ? $\endgroup$
    – Verbeia
    Commented Dec 2, 2014 at 6:10

1 Answer 1


Based on the comments appended to the question, I believe that what you are looking for is:

mvBeta[myrating, #, myR] & /@ RandomReal[{0,1},100]

where you can change 100 to be any length vector you like, and myrating and myR have already been defined.

  • $\begingroup$ Hmm. This might work but now it gives me an error in another place. Would you know how to generate a vector of multivariate standard normals that must have a given correlation matrix? $\endgroup$
    – Jim
    Commented Dec 2, 2014 at 6:41
  • $\begingroup$ reference.wolfram.com/language/ref/MultinormalDistribution.html RandomVariate[MultinormalDistribution[parameters],numberofiterates] $\endgroup$
    – Verbeia
    Commented Dec 2, 2014 at 6:54
  • $\begingroup$ Thank you. I understand I need to use the MultinormalDistribution function. However, I am not sure how to make it so that my vector of standard normals have a given correlation matrix, say R. $\endgroup$
    – Jim
    Commented Dec 2, 2014 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.