it appears to be that when i use SVD i loose prescision how can i avoid loosing prescision and use svd function?
[U,S,V]=svd(T);
T=U*S*V'
the first T Matrix and the second are not the same.
here a comparation of the matrix before svd and after:
>> T
T =
-0.4609 + 0.4970i 0.0023 + 0.0267i -0.0267 + 0.0028i
0.0023 + 0.0270i -0.5192 - 0.4982i -0.0023 - 0.0267i
-0.0267 + 0.0028i -0.0023 - 0.0270i -0.4609 + 0.4970i
>> [U,S,V]=svd(T); >> Tsvd=U*S*V'
Tsvd =
-0.4609 + 0.4970i 0.0023 + 0.0267i -0.0267 + 0.0028i
0.0023 + 0.0270i -0.5192 - 0.4982i -0.0023 - 0.0267i
-0.0267 + 0.0028i -0.0023 - 0.0270i -0.4609 + 0.4970i
>> difference=T-Tsvd
difference =
1.0e-15 *
-0.0555 - 0.1110i 0.0247 - 0.0312i -0.4025 + 0.3092i
-0.0278 - 0.0173i 0.0000 - 0.3331i -0.0494 + 0.0555i
-0.0486 + 0.0867i 0.0694 + 0.1076i 0.0000 + 0.0555i

댓글 수: 4

Oleg Komarov
Oleg Komarov 2014년 10월 14일
Post a concrete example.
Kobi
Kobi 2014년 10월 14일
example has been posted in the original question.
Roger Stafford
Roger Stafford 2014년 10월 14일
Kobi, that is just expected round-off error out at the fifteenth decimal place. You can't expect any better precision than that using double precision floating point numbers. After all, these numbers have only 53 bits in their significands. Your description of "very bad" is quite unfair.
Stephen23
Stephen23 2014년 10월 14일
편집: Stephen23 2014년 10월 14일
Some information on Floating Point Numbers in MATLAB:

댓글을 달려면 로그인하십시오.

 채택된 답변

Andreas Goser
Andreas Goser 2014년 10월 14일

1 개 추천

Please let us know how familiar your are with numerical mathematics. The effect you see here is to be expected, but I do not want to come across as too blunt just pointing you to
eps
I could find a document that describes a bit about the why.

댓글 수: 3

Kobi
Kobi 2014년 10월 14일
i'm familiar with numerical mathematics pi is 3.14...... on double precision is 25 digits after the floating point also on e 2.71..... (natural number)
i tried to open the svd function to see what operation cause that
>> open svd
nothing there only comments. i don't think the error is because of the matrix product can you please point me to the math in svd that cause this error?
Oleg Komarov
Oleg Komarov 2014년 10월 14일
편집: Oleg Komarov 2014년 10월 14일
Where do you take 25 digits from?
>> fprintf('%.20f\n',pi)
3.14159265358979310000
>> fprintf('%.20f\n',eps(pi))
0.00000000000000044409
>> fprintf('%.20f\n',pi+eps(pi))
3.14159265358979360000
Andreas Goser
Andreas Goser 2014년 10월 14일
I can recommend this article for a deeper understanding.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Roger Stafford
Roger Stafford 2014년 10월 14일
편집: Roger Stafford 2014년 10월 14일

2 개 추천

You cannot expect them to be exactly the same because of rounding errors. Have you compared them using "format long" to see how significant the differences are?
If you are still unsatisfied, please give a representative sample of what you have observed.

댓글 수: 1

Kobi
Kobi 2014년 10월 14일
example has been posted in the original question.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

질문:

2014년 10월 13일

댓글:

2014년 10월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by