For buildCor
, the size of the returned correlation matrix is set using n
;
an n
by n
correlation matrix is returned. For buildCov
the size is
set to length(s)
by length(s)
.Each row of cors
specifies a correlation term $r[i,j]$ in the form
$(i, j, r[i,j]$. That is, the first two columns give the row
and column in the desired correlation matrix, and the third gives the relevant
correlation coefficient. On constructing or updating the correlation matrix,
$r[i,j]$ is set equal to $r[j,i]$, so it is only necessary
to specify one of $r[i,j]$ or $r[j,i]$.
covs
specifies covariance terms in the same way except that the third column of
covs
must be a covariance.
If either cors
or covs
is a vector of length 3, it is coerced
to a matrix of three columns.
If cor.names
or cov.names
are present, the matrix returned has
dimnames set to the names supplied.
All four functions test for positive definite return values and generate a
warning if not positive definite.