Title: | Objective General Index |
---|---|
Description: | Consider a data matrix of n individuals with p variates. The objective general index (OGI) is a general index that combines the p variates into a univariate index in order to rank the n individuals. The OGI is always positively correlated with each of the variates. More details can be found in Sei (2016) <doi:10.1016/j.jmva.2016.02.005>. |
Authors: | Tomonari Sei [aut], Masaki Hamada [cre] |
Maintainer: | Masaki Hamada <[email protected]> |
License: | GPL-3 |
Version: | 1.0.0 |
Built: | 2024-11-20 06:26:41 UTC |
Source: | CRAN |
cov2biu(S)
returns the bi-unit canonical form of S
.
cov2biu(S, nu = rep(1, nrow(S)), force = FALSE, detail = FALSE)
cov2biu(S, nu = rep(1, nrow(S)), force = FALSE, detail = FALSE)
S |
Covariance matrix, especially it is positive semi-definite. |
nu |
Numeric vector of subjective importance. It determines the importance of each of the variates. |
force |
Logical: if force=FALSE, |
detail |
Logical: if detail=TRUE, it returns the list of the bi-unit form and the weight vectors. Default: FALSE. |
Numeric matrix of the bi-unit canonical form of
.
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 } } B=cov2biu(S) B
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 } } B=cov2biu(S) B
cov2weight(S)
returns the numeric vector in which the diagonal
elements of the matrix are arranged, where
is the bi-unit
canonical form of
.
cov2weight(S, Dvec = rep(1, nrow(S)), nu = rep(1, nrow(S)), tol = 1e-06, force = FALSE)
cov2weight(S, Dvec = rep(1, nrow(S)), nu = rep(1, nrow(S)), tol = 1e-06, force = FALSE)
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 |
force |
Logical: if force=FALSE, |
Numeric vector of diagonal elements of , which appears in the
bi-unit canonical form
of
.
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
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(X)
returns the objective general index (OGI) of the covariance
matrix S
of X
.
ogi(X, se = FALSE, force = FALSE, se.loop = 1000, nu = rep(1, ncol(X)), center = TRUE, mar = FALSE)
ogi(X, se = FALSE, force = FALSE, se.loop = 1000, nu = rep(1, ncol(X)), center = TRUE, mar = FALSE)
X |
Numeric or ordered matrix. |
se |
Logical: if se=TRUE, it additionally computes |
force |
Logical: if force=FALSE, |
se.loop |
Iteration number in bootstrap for computation of standard error. |
nu |
Numeric vector of subjective importance. It determines the
importance of each column of |
center |
Logical: if center=TRUE, |
mar |
Logical: if mar=TRUE, each of ordered categorical variates of
|
Consider a data matrix of individuals with
variates. The
objective general index (OGI) is a general index that combines the
variates into a univariate index in order to rank the
individuals.
The OGI is always positively correlated with each of the variates. For more
details, see the references.
value |
The objective general index (OGI). |
X |
The input matrix |
scaled |
The product of |
Z |
Numerical matrix converted from |
weight |
The output of |
rel.weight |
The product of |
biu |
The bi-unit canonical form of the covariance matrix of |
idx |
Numeric vector. If |
w.se |
If requested, |
v.se |
If requested, |
Sei, T. (2016). An objective general index for multivariate ordered data, Journal of Multivariate Analysis, 147, 247-264. http://www.sciencedirect.com/science/article/pii/S0047259X16000269
CT = matrix(c( 2,1,1,0,0, 8,3,3,0,0, 0,2,1,1,1, 0,0,0,1,1, 0,0,0,0,1), 5, 5, byrow=TRUE) X = matrix(0, 0, 2) for(i in 1:5){ for(j in 1:5){ if(CT[i,j]>0){ X = rbind(X, matrix(c(6-i,6-j), CT[i,j], 2, byrow=TRUE)) } } } X0 = X X = as.data.frame(X0) X[,1] = factor(X0[,1], ordered=TRUE) X[,2] = factor(X0[,2], ordered=TRUE) ogiX = ogi(X) par(pty="s", cex=1.7, mar=c(4.5,3,1,1)) plot(ogiX$scaled, xlim=c(-3,3), ylim=c(-3,3), xlab="Geometry", ylab="Probability") for(t in 1:nrow(ogiX$scaled)){ xy = ogiX$scaled[t,] g = rep(sum(xy)/2, 2) segments(xy[1], xy[2], g[1], g[2], lty=2) } arrows(-3, -3, 3, 3) text(2.5, 2, "OGI/2") ogiX f = ordered(1:10) f[sample(1:10, 20, replace=TRUE)] Y = ogi(f)$value plot((1:10)/(10+1), Y, type="b") xs = (1:1000)/1001 points(xs, qnorm(xs), type="l", col="red") X = USJudgeRatings ogiX = ogi(X) nameX = ordered(names(X), names(X)) plot(nameX, ogiX$weight, las=3, cex.axis=0.8, ylim=c(0,1.2), ylab="weight")
CT = matrix(c( 2,1,1,0,0, 8,3,3,0,0, 0,2,1,1,1, 0,0,0,1,1, 0,0,0,0,1), 5, 5, byrow=TRUE) X = matrix(0, 0, 2) for(i in 1:5){ for(j in 1:5){ if(CT[i,j]>0){ X = rbind(X, matrix(c(6-i,6-j), CT[i,j], 2, byrow=TRUE)) } } } X0 = X X = as.data.frame(X0) X[,1] = factor(X0[,1], ordered=TRUE) X[,2] = factor(X0[,2], ordered=TRUE) ogiX = ogi(X) par(pty="s", cex=1.7, mar=c(4.5,3,1,1)) plot(ogiX$scaled, xlim=c(-3,3), ylim=c(-3,3), xlab="Geometry", ylab="Probability") for(t in 1:nrow(ogiX$scaled)){ xy = ogiX$scaled[t,] g = rep(sum(xy)/2, 2) segments(xy[1], xy[2], g[1], g[2], lty=2) } arrows(-3, -3, 3, 3) text(2.5, 2, "OGI/2") ogiX f = ordered(1:10) f[sample(1:10, 20, replace=TRUE)] Y = ogi(f)$value plot((1:10)/(10+1), Y, type="b") xs = (1:1000)/1001 points(xs, qnorm(xs), type="l", col="red") X = USJudgeRatings ogiX = ogi(X) nameX = ordered(names(X), names(X)) plot(nameX, ogiX$weight, las=3, cex.axis=0.8, ylim=c(0,1.2), ylab="weight")