rvmatrix {rv}R Documentation

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.

Author(s)

Jouni Kerman kerman@stat.columbia.edu http://www.stat.columbia.edu/~kerman

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

  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))  

[Package rv version 0.949 Index]