Description Usage Arguments Details Value Note Author(s) See Also Examples

Randomly generate a mean vector and covariance matrix describing a multivariate normal (MVN) distribution, and then sample from it

1 2 3 |

`N` |
number of samples to draw |

`d` |
dimension of the MVN, i.e., the length of the mean vector and the number of rows/cols of the covariance matrix |

`method` |
the default generation method is |

`mup` |
a |

`s2p` |
a |

`pnz` |
a scalar |

`nu` |
a scalar |

In the direct method (`"normwish"`

) the components of the
mean vector `mu`

are iid from a standard normal distribution,
and the covariance matrix `S`

is
drawn from an inverseâ€“Wishart distribution with degrees of freedom
`d + 2`

and mean (centering matrix) `diag(d)`

In the `"parsimonious"`

method `mu`

and `S`

are
built up sequentially by randomly sampling intercepts, regression
coefficients (of length `i-1`

for `i in 1:d`

) and variances
by applying the `monomvn`

equations. A unique prior results
when a random number of the regression coefficients are set to zero.
When none are set to zero the direct method results

The return value is a `list`

with the following components:

`mu ` |
randomly generated mean vector of length |

`S ` |
randomly generated covariance |

`x ` |
if |

requires the `rmvnorm`

function of the
mvtnorm package

Robert B. Gramacy rbg@vt.edu

1 | ```
randmvn(5, 3)
``` |

```
Loading required package: pls
Attaching package: 'pls'
The following object is masked from 'package:stats':
loadings
Loading required package: lars
Loaded lars 1.2
Loading required package: MASS
$x
[,1] [,2] [,3]
[1,] 0.3712477 -0.09887911 0.5730451
[2,] 0.6717559 -0.61513684 -0.1571736
[3,] -0.1466544 -0.56655052 0.0900901
[4,] -0.4736711 -0.73359755 -0.5333514
[5,] 2.3486718 -0.85397794 0.3184048
$mu
[1] 0.4798136 -0.4853351 0.1373202
$S
[,1] [,2] [,3]
[1,] 0.9063796 0.3162725 0.2279514
[2,] 0.3162725 0.2712846 0.1269866
[3,] 0.2279514 0.1269866 0.2272378
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.