> den = sqrt(dot(x-mean(x),x-mean(x))*dot(y-mean(y),y-mean(y))) Īs a final note, the terms correlation matrix and covariance matrix must be used cautiously when the mean of the underlying distributions is not zero. These are the off-diagonal elements of your covariance matrix. If you don't have access to corrcoef (can't recall if it requires a toolbox), you can compute from first principles as shown below. You can find the formula implemented by corrcoef in the documentation. I *think* what you are really trying to compute can be accomplished as shown below. While noise can certainly be uniform, was your intent to generate Gaussian noise instead? in MATLAB rand produces uniformly distributed data (between 0 and 1) while randn produces normally distributed data (with mean 0 and variance 1). I was trying to learn the concept de-correlation and any help here would be really appreciated! Thanks in advance! If A is a row or column vector, C is the scalar-valued variance. The variances of the columns are along the diagonal. One more question, in terms of vector representation will it be correct to say that a vector R can be represented using r1 and r2, where R is a two dimensional vector (I was trying to link a real scenario to the vector space concepts and was getting confused)? Also how can we represent R in terms of its basis vectors? For single matrix input, C has size size(A,2) size(A,2) based on the number of random variables (columns) represented by A. My doubt here is that is this correlation matrix correctly generated? I was expecting a diagonal matrix but here the non-diagonal elements are non-zero?Īlso is it that r1 and r2 are not independent of each other? The Correlation Matrix resulted in as below with some randomly generated sequence r1,r2: Given a sample consisting of n independent observations x 1.I was trying to create a Noise Cross Correlation Matrix in Matlab by using the following code:ĬorrMatrix = *./N
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |