cov2weight: Weight Vectors of the Bi-unit Canonical Form

Description Usage Arguments Value Examples

Description

cov2weight(S) returns the numeric vector in which the diagonal elements of the matrix D are arranged, where DSD is the bi-unit canonical form of S.

Usage

1
2
cov2weight(S, Dvec = rep(1, nrow(S)), nu = rep(1, nrow(S)), tol = 1e-06,
  force = FALSE)

Arguments

S

Covariance matrix, especially it is positive semi-definite.

Dvec

Numeric vector of initial values of iteration.

nu

Numeric vector of subjective importance. It determines the importance of each of the variates.

tol

Numeric number of tolerance. If the minimum eigenvalue of S is less than tol, S is considered not to be positive definite.

force

Logical: if force=FALSE, S should be strictly positive definite. Default: FALSE.

Value

Numeric vector of diagonal elements of D, which appears in the bi-unit canonical form DSD of S.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
S = matrix(0, 5, 5)
S[1,1] = 1
for(j in 2:5) S[1,j] = S[j,1] = -0.5
for(i in 2:5){
  for(j in 2:5){
    if(i == j) S[i,j] = 1
    else S[i,j] = 0.5
  }
}
weight=cov2weight(S)
weight

OGI documentation built on May 2, 2019, 8:55 a.m.

Related to cov2weight in OGI...