# Simulating from Custom Function

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:

mvBeta[rating_,x_,R_]:=densityProduct[rating,x]*mvnCopula[copulaInput[rating,x],R]


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.

• 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? – Verbeia Dec 2 '14 at 5:25
• This is just a guess without more information, but something using Map (/@) is probably what you want: mvBeta[rating,#,r]&/@ xvector. – Verbeia Dec 2 '14 at 5:31
• 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 – Jim Dec 2 '14 at 5:58
• xvector = RandomReal[{0,1},100] ? – Verbeia Dec 2 '14 at 6:10

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.
• reference.wolfram.com/language/ref/MultinormalDistribution.html RandomVariate[MultinormalDistribution[parameters],numberofiterates] – Verbeia Dec 2 '14 at 6:54