svdDemo | R Documentation |
This function draws an rgl
scene consisting of a representation of the identity matrix and a
3 x 3 matrix A
, together with the corresponding representation of the
matrices U, D, and V in the SVD decomposition,
A = U D V'.
svdDemo(A, shape = c("cube", "sphere"), alpha = 0.7, col = rainbow(6))
A |
A 3 x 3 numeric matrix |
shape |
Basic shape used to represent the identity matrix: |
alpha |
transparency value used to draw the shape |
col |
Vector of 6 colors for the faces of the basic cube |
Nothing
Original idea from Duncan Murdoch
A <- matrix(c(1,2,0.1, 0.1,1,0.1, 0.1,0.1,0.5), 3,3)
svdDemo(A)
## Not run:
B <- matrix(c( 1, 0, 1, 0, 2, 0, 1, 0, 2), 3, 3)
svdDemo(B)
# a positive, semi-definite matrix with eigenvalues 12, 6, 0
C <- matrix(c(7, 4, 1, 4, 4, 4, 1, 4, 7), 3, 3)
svdDemo(C)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.