필터 지우기
필터 지우기

can anybody help to check my matrix is semidefinite positive or not

조회 수: 4 (최근 30일)
vikas Kumar
vikas Kumar 2019년 7월 29일
댓글: vikas Kumar 2019년 7월 30일
summation =
1.0e-07 *
Columns 1 through 11
0.2140 0.0972 0.0986 0.0953 0.0934 0.0985 0.0980 0.0985 0.0927 0.0967 0.0611
0.0972 0.2102 0.0976 0.0948 0.0929 0.0975 0.0972 0.0976 0.0922 0.0961 0.1044
0.0986 0.0976 0.2166 0.0953 0.0931 0.0996 0.0986 0.0995 0.0924 0.0970 0.1060
0.0953 0.0948 0.0953 0.2012 0.0914 0.0953 0.0953 0.0955 0.0908 0.0944 0.1013
0.0934 0.0929 0.0931 0.0914 0.1910 0.0932 0.0934 0.0934 0.0893 0.0925 0.0984
0.0985 0.0975 0.0996 0.0953 0.0932 0.2166 0.0985 0.0993 0.0925 0.0970 0.1064
0.0980 0.0972 0.0986 0.0953 0.0934 0.0985 0.2140 0.0985 0.0927 0.0967 0.1057
0.0985 0.0976 0.0995 0.0955 0.0934 0.0993 0.0985 0.2166 0.0928 0.0971 0.1066
0.0927 0.0922 0.0924 0.0908 0.0893 0.0925 0.0927 0.0928 0.1872 0.0919 0.0975
0.0967 0.0961 0.0970 0.0944 0.0925 0.0970 0.0967 0.0971 0.0919 0.2080 0.1036
0.0450 0.1044 0.1060 0.1013 0.0984 0.1064 0.1057 0.1066 0.0975 0.1036 0.2280
0.1058 0.0489 0.1061 0.1013 0.0984 0.1064 0.1058 0.1066 0.0976 0.1036 0.1072
0.1057 0.1043 0.0329 0.1012 0.0984 0.1064 0.1057 0.1066 0.0975 0.1035 0.1071
0.1058 0.1044 0.1061 0.0552 0.0985 0.1065 0.1058 0.1066 0.0976 0.1036 0.1073
0.1058 0.1044 0.1061 0.1013 0.0554 0.1064 0.1058 0.1066 0.0976 0.1036 0.1073
0.1057 0.1044 0.1060 0.1012 0.0984 0.0362 0.1057 0.1066 0.0975 0.1036 0.1071
0.1057 0.1044 0.1060 0.1013 0.0984 0.1064 0.0450 0.1066 0.0975 0.1036 0.1072
0.1057 0.1044 0.1060 0.1013 0.0984 0.1064 0.1057 0.0397 0.0975 0.1036 0.1071
0.1058 0.1044 0.1061 0.1013 0.0984 0.1064 0.1058 0.1066 0.0548 0.1036 0.1072
0.1058 0.1044 0.1061 0.1013 0.0984 0.1064 0.1058 0.1066 0.0976 0.0509 0.1072
Columns 12 through 20
0.1058 0.1057 0.1058 0.1058 0.1057 0.1057 0.1057 0.1058 0.1058
0.0489 0.1043 0.1044 0.1044 0.1044 0.1044 0.1044 0.1044 0.1044
0.1061 0.0329 0.1061 0.1061 0.1060 0.1060 0.1060 0.1061 0.1061
0.1013 0.1012 0.0552 0.1013 0.1012 0.1013 0.1013 0.1013 0.1013
0.0984 0.0984 0.0985 0.0554 0.0984 0.0984 0.0984 0.0984 0.0984
0.1064 0.1064 0.1065 0.1064 0.0362 0.1064 0.1064 0.1064 0.1064
0.1058 0.1057 0.1058 0.1058 0.1057 0.0450 0.1057 0.1058 0.1058
0.1066 0.1066 0.1066 0.1066 0.1066 0.1066 0.0397 0.1066 0.1066
0.0976 0.0975 0.0976 0.0976 0.0975 0.0975 0.0975 0.0548 0.0976
0.1036 0.1035 0.1036 0.1036 0.1036 0.1036 0.1036 0.1036 0.0509
0.1072 0.1071 0.1073 0.1073 0.1071 0.1072 0.1071 0.1072 0.1072
0.2281 0.1071 0.1073 0.1073 0.1071 0.1072 0.1072 0.1073 0.1072
0.1071 0.2280 0.1072 0.1072 0.1070 0.1071 0.1071 0.1072 0.1071
0.1073 0.1072 0.2282 0.1073 0.1072 0.1073 0.1072 0.1073 0.1073
0.1073 0.1072 0.1073 0.2282 0.1072 0.1073 0.1072 0.1073 0.1073
0.1071 0.1070 0.1072 0.1072 0.2280 0.1071 0.1071 0.1072 0.1072
0.1072 0.1071 0.1073 0.1073 0.1071 0.2280 0.1071 0.1072 0.1072
0.1072 0.1071 0.1072 0.1072 0.1071 0.1071 0.2280 0.1072 0.1072
0.1073 0.1072 0.1073 0.1073 0.1072 0.1072 0.1072 0.2282 0.1073
0.1072 0.1071 0.1073 0.1073 0.1072 0.1072 0.1072 0.1073 0.2281
eig(summation) is positive even then matlab says
Error using mvnrnd (line 110)
'summation' must be a symmetric positive semi-definite matrix.
  댓글 수: 2
David Goodmanson
David Goodmanson 2019년 7월 29일
편집: David Goodmanson 2019년 7월 30일
Hi vikas,
this may be some kind of error due to cutting and pasting. However:
>> summation(11,1)
ans = 450000
>> summation(1,11)
ans = 611000
so the matrix is not symmetric.
vikas Kumar
vikas Kumar 2019년 7월 30일
Thanks David Goodmanson, for replying. Although i have used nearestSPD(summation) function that has solved my problem.

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

답변 (1개)

Steven Lord
Steven Lord 2019년 7월 29일
If that difference in summation(11, 1) and summation(1, 11) David Goodmanson noted is just a copy-and-paste error, it would still be worth a quick check to see if your matrix issymmetric. Your matrix may be close to symmetric, but this is neither horseshoes nor hand grenades so "close" doesn't count.
If it isn't symmetric, depending on how "far away from symmetric" it is replacing it with the average of itself and its transpose may be acceptable. To check this, see what the maximum difference is.
maximumDifference = max(summation-summation.', 'all') % R2018b or later
D = summation-summation.';
maximumDifference = max(D(:)) % R2018a or earlier
As I noted in the comment, max only accepts the 'all' option in release R2018b and later releases. If that difference is "small" (for your definition of "small") use this matrix instead.
symmetricSummation = (summation+summation.')./2;
  댓글 수: 1
David Goodmanson
David Goodmanson 2019년 7월 29일
편집: David Goodmanson 2019년 7월 30일
I had checked it, using
[a b] = find((m-m')~=0)
and the two elements noted before were the only ones that did not meet exact equality. But since the matrix was copied into the window using a four-decimal-place format, there is always the significant possibility that some matrix elements disagree in decimal places further on down the line. Strict equality in floating point is not always easy to achieve.

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

카테고리

Help CenterFile Exchange에서 Matrix Operations and Transformations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by