correlation between binary strings

조회 수: 13 (최근 30일)
Maria Imdad
Maria Imdad 2021년 4월 9일
댓글: Walter Roberson 2021년 4월 9일
hi everyone I want to find the correlation between these two binary strings x and y
x=[1111111111111111111111111111111111111111111111111111111111111111];
y=[1000000001011001010110111110010101011010010000100010111101111110];
using the formula attached as figure. the value of E is 0.05 or 50%.
Thank you in advance
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 4월 9일
the value of E is 0.05 or 50%.
?? 0.05 would be 5% not 50% ?

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

답변 (2개)

Maria Imdad
Maria Imdad 2021년 4월 9일
편집: Maria Imdad 2021년 4월 9일
0.05
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 4월 9일
If the values are represented by 0 and 1, then it seems to me using 0.5 would make more sense...
Maria Imdad
Maria Imdad 2021년 4월 9일
yes exactly

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


Walter Roberson
Walter Roberson 2021년 4월 9일
R = sum((x - E).*(y - E)) ./ (sqrt(sum((x-E).^2)) .* sqrt(sum((y-E).^2)));
  댓글 수: 2
Maria Imdad
Maria Imdad 2021년 4월 9일
will this formula compare and compute correlation between each corresponding bit? because i want it to iterrate for all 64 bits
Walter Roberson
Walter Roberson 2021년 4월 9일
It handles all of x and all of y, assuming that they are the same size. It uses vector operations so it does not need to loop. The sigma operation in the equation is sum() here.

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

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by