sampleCovMat {bayesSurv} | R Documentation |
Compute a sample covariance matrix.
Description
This function computes a sample covariance matrix.
Usage
sampleCovMat(sample)
Arguments
sample |
a |
Details
When is a sequence of
-dimensional vectors
the sample covariance
matrix
is equal to
where
When the function returns just sum of squares.
Value
This function returns a matrix.
Author(s)
Arnošt Komárek arnost.komarek@mff.cuni.cz
Examples
## Sample some values
z1 <- rnorm(100, 0, 1) ## first components of y
z2 <- rnorm(100, 5, 2) ## second components of y
z3 <- rnorm(100, 10, 0.5) ## third components of y
## Put them into a data.frame
sample <- data.frame(z1, z2, z3)
## Compute a sample covariance matrix
sampleCovMat(sample)
[Package bayesSurv version 3.7 Index]