How to generate Random Matrix with rmvnorm function
In this article Xiaobian for you to introduce in detail "how to use rmvnorm function to generate random matrix", the content is detailed, the steps are clear, the details are handled properly, I hope this "how to use rmvnorm function to generate random matrix" article can help you solve your doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge.
With the help of rmvnorm () to generate a multidimensional normal random matrix, install the mvtnormalization package > install.packages ("mvtnorm") > library (mvtnorm) to generate random matrices x=rmvnorm (x=rmvnorm (0menthnrow (sigma)), sigma=diag (length (mean) …) ...
Generate a multidimensional normal random matrix with the help of rmvnorm ()
Install the mvtnormalization package
> install.packages ("mvtnorm") > library (mvtnorm)
Generate random matrix
X=rmvnorm (length (mean)), sigma=diag (length).
For example
> x = rmvnorm (5 recordrep (0BE3), diag (3)) > x [, 1] [, 2] [, 3] [1,] 0.2319038-0.22077218 0.5232609 [2,] 0.2374806-2.33881461-0.6796371 [3,] 0.3614914-0.07900088 0.2848471 [4,] 1.4700363-1.26901580-0.4505197 [5,]-1.5877496 0.01318156-2.1257104
Mean=rep (0MagneNrow (sigma), can also change the size of the mean vector, for example: rep (1meme2), or rep (2meme3). Even negative numbers.
Read here, this article "how to use rmvnorm function to generate random matrix" article has been introduced, want to master the knowledge of this article still need to practice and use to understand, if you want to know more about the article, welcome to follow the industry information channel.