here is a matrix
A = matrix(c(1,1,2,2,0,0), nrow = 3,byrow = TRUE)
this code is to find the svd for it
>svd(A)
$d
[1] 3.162278e+00 1.570092e-16
$u
[,1] [,2]
[1,] -0.4472136 -0.8944272
[2,] -0.8944272 0.4472136
[3,] 0.0000000 0.0000000
$v
[,1] [,2]
[1,] -0.7071068 -0.7071068
[2,] -0.7071068 0.7071068
for matrix A, both
$u
[,1] [,2]
[1,] -0.4472136 -0.8944272
[2,] -0.8944272 0.4472136
[3,] 0.0000000 0.0000000
and
$u
[,1] [,2]
[1,] 0.4472136 0.8944272
[2,] 0.8944272 -0.4472136
[3,] 0.0000000 0.0000000
are correct solution.
the question is: why does R choose the negative one?
for another case, R choose the positive one.
A = matrix(c(5,5,-1,7), nrow = 2,byrow = TRUE)
$u
[,1] [,2]
[1,] 0.7071068 0.7071068
[2,] 0.7071068 -0.7071068