Computes variances of the simulations of components of a random vector of array.
rvvar(x)
an object
A numeric vector or array (of the same dimension as that of
x
)
rvvar
computes the means of the simulations of all individual
components of a random vector (rv) object.
That is, rvvar
applies the function var
to the vector of
simulations of each component of x
, thus computing "columnwise"
variances of the matrix of simulations of x
.
rvsd
applies the function sd
to the vector of simulations of
each component of x
, thus computing "columnwise" standard deviations
of the matrix of simulations of x
.
Kerman, J. and Gelman, A. (2007). Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Statistics and Computing 17:3, 235-244.
See also vignette("rv")
.
x <- rvnorm(mean=0, var=1:10)
rvvar(x)
#> [1] 1.040558 1.988681 2.604101 3.650395 4.419348 5.619464 6.172546
#> [8] 6.885114 9.417672 10.037993
rvsd(x)
#> [1] 1.020077 1.410206 1.613723 1.910601 2.102224 2.370541 2.484461 2.623950
#> [9] 3.068823 3.168279