to.shape | R Documentation |
This function rescales a given matrix such that its determinant, trace or the value of the first diagonal element meets a criteria.
to.shape(M, determ, trace, first)
M |
a matrix to be scaled |
determ |
required value for determinant |
trace |
required value for trace |
first |
required value of the first diagonal element |
If determ
, trace
or first
is given
M
is scaled such that its determinant, trace or first diagonal
element, respectively, equals that value. If none of the three is
given M
is scaled such that its determinant equals one. If more
than one criteria is given the first of them is used and the others
silently ignored.
The rescaled matrix
A shape matrix is symmetric and positive definite square matrix. In order for the result to be such the argument matrix M
should also be symmetric and positive definite square matrix. However, the function does not check for this. Expect to see errors if M
is of inappropriate type.
Seija Sirkia, seija.sirkia@iki.fi
Paindaveine D. (2008) A Canonical Definition of Shape. Statistics and Probability Letters 78, 2240-2247
(A<-matrix(c(1,2,-3,4,3,-2,-1,0,4),ncol=3)) to.shape(A%*%t(A)) to.shape(A%*%t(A),trace=3) to.shape(A%*%t(A),first=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.