Simplex vectors
makes "n" vectors of "n-1" simplex in "n"-dimensional space
nc-1 正単体(nc個の頂点)の頂点ベクトルを作る
CategoryVector(4)
CategoryVector<-
function (nc = 3)
{
df <- nc - 1
d <- df + 1
diagval <- 1:d
diagval <- sqrt((df + 1)/df) * sqrt((df - diagval + 1)/(df -
diagval + 2))
others <- -diagval/(df - (0:(d - 1)))
m <- matrix(rep(others, df + 1), nrow = df + 1, byrow = TRUE)
diag(m) <- diagval
m[upper.tri(m)] <- 0
as.matrix(m[, 1:df])
}
\name{CategoryVector}
\alias{CategoryVector}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Simplex vectors
}
\description{
makes "n" vectors of "n-1" simplex in "n"-dimensional space
nc-1 正単体(nc個の頂点)の頂点ベクトルを作る
}
\usage{
CategoryVector(n)
}
%- maybe also 'usage' for other objects documented here.
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{
(n)x(n-1) matrix returns.
n vectors in (n-1)-dimensional space.
All vectors has norm 1.
Inner product of all vector pairs are -1/(n-1).
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%% ~~who you are~~
}
\note{
%% ~~further notes~~
}
%% ~Make other sections like Warning with \section{Warning }{....} ~
\seealso{
%% ~~objects to See Also as \code{\link{help}}, ~~~
}
\examples{
cv<-CategoryVector(4)
# norm and inner product of pairs
cv %*% t(cv)
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ ~kwd1 }
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line