From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of Rafael
Guerra
Sent: 08 February 2018 18:55
To: Users mailing list for Scilab <users@lists.scilab.org>
Subject: Re: [Scilab-users] spatial correlation coefficient: Is the MATLAB
corrcoef function doing the job?

 

Hi Heinz,

 

Scilab computes the covariance matrix and from which the correlation matrix
can be obtained using formula in
https://en.wikipedia.org/wiki/Covariance_matrix

 

Check implementation below:

 

//START OF CODE

// https://en.wikipedia.org/wiki/Covariance_matrix

function Y=corrmatrix(M)

    C = cov(M);  // covariance matrix

    D = sqrt(diag(C)); // standard deviations

    D = inv(diag(D));

    Y = D*C*D;  // correlation matrix

endfunction

 

M = grand(9,3,"def")

M(:,2) = M(:,1)*2;

Y = corrmatrix(M);

disp(M,"M")

disp(Y,"Y")

// END OF CODE

 

For random generated xyz positions, I get the matrix below and this looks
fine with me:


1.000

-0.009

-0.003


-0.009

1.000

-0.001


-0.003

-0.001

1.000


 

 

 

                

 

But this here is a manufactured object and every singly xyz-value is
obtained from X-ray tomography

https://www.dropbox.com/s/87osn38agn8jfzo/Measured%2016867%20data%20points%2
0in%203d.png?dl=0

 

and looks much more regular than the Monte-Carlo. However, the correlation
analysis suggested here, gives much the same numbers.


1.000

-0.009

0.008


-0.009

1.000

-0.001


0.008

-0.001

1.000

 

Perhaps, I have asked the wrong question: 

 

 

-->what I need is one single figures that summarizes the spatial
correlation.

 

Heinz

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to