Learn R Programming

rv (version 0.949)

rvmatrix: Matrices and Arrays of Random Vectors

Description

Arrange a given random vector into a matrix or array form.

Usage

rvmatrix(...)
 rvarray(...)

Arguments

...
arguments passed to matrix or to array

Details

These are 'rv' compatible versions of the functions rvmatrix and rvarray.

References

Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.

See Also

mlplot

Examples

Run this code
n.rows <- 3; n.cols <- 4; n <- (n.rows*n.cols)
  mu.true <- rnorm(1:n.rows, mean=1:n.rows, sd=1)
  theta <- rvmatrix(rvnorm(n=n.cols, mean=mu.true, sd=0.5), nrow=n.rows)
  col.labels <- paste("Time", 1:n.cols, sep=":")
  row.labels <- paste("Unit", 1:n.rows, sep=":")
  dimnames(theta) <- list(row.labels, col.labels)
  print(theta)
  print(E(theta))

Run the code above in your browser using DataLab