Message Boards Message Boards

0
|
797 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to generate a list that represents a multinormal distribution?

Posted 5 months ago

I want to generate a list that represents a multinormal population, with 20 samples of size 10. With the means:{7,4,5,6} and covariances {{1,0.5,0.5,0.5}, {0.5,1,0.5,0.5}, {0.5,0.5,1,0.5}, {0.5,0.5,0.5,1}}. I expect to get a 10 x 20 array. The current status of my none-working code:

    Needs["MultivariateStatistics`"]
    dist=RandomReal[MultinormalDistribution[{7,4,5,6},{{1,0.5,0.5,0.5},{0.5,1,0.5,0.5},{0.5,0.5,1,0.5},{0.5,0.5,0.5,1}}]
    exampleList = RandomChoice[dist,{20,10}]
POSTED BY: Jürgen Kanz
2 Replies

Yes, it works. Thank you, Gianluca.

POSTED BY: Jürgen Kanz

Have you tried this:

dist = MultinormalDistribution[{7, 4, 5, 6},
   {{1, 0.5, 0.5, 0.5}, {0.5, 1, 0.5, 0.5},
    {0.5, 0.5, 1, 0.5}, {0.5, 0.5, 0.5, 1}}];
exampleList = RandomReal[dist, {20, 10}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract