Calculating the between-column squared correlations

I want to use the Latin hypercube sample function (lhsdesign). In the examples provided in the documentation the quality of the generated design is measured by calculating the sum of between-column aquared correlations,
rng default % For reproducibility
X= lhsdesign(10,4); % X is a 10-by-4 design matrix.
y= corr(X);
(sum(y(:).^2)-4)/2 % the 4 subtracted to remove the ones on the diagonal of y.
Why was the sum of the squared correlations divided by 2 ?
Thanks

 채택된 답변

Matt J
Matt J 2021년 10월 31일
편집: Matt J 2021년 10월 31일

0 개 추천

I would guess it's account for the symmetry of the y matrix ... so that off-diagonal terms will not be double counted.

댓글 수: 1

True! I didn't notice at all! Thanks a lot for taking the time.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Industrial Statistics에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2021년 10월 31일

댓글:

2021년 11월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by