How can we efficiently implement calculation of correlation matrix (pearson correlation) using opencl? Can anyone help me with the kernel function?
Related
I am simulating data using a gaussian copula which requires a correlation matrix. To construct the correlation matrix, I got its correlation coefficients from literature/past studies. However, how do you deal with a non-positive definite matrix when simulating non-normal data using a Gaussian copula and ensuring that the final outcome presents a correlation that contains almost similar values as the correlation matrix used to simulate the data?
Approaches of dealing with the challenge stated above in R programming
I have a likelihood function in R that I am optimizing using 'optim' and calculating the hessian matrix using hessian=T in the optim function. I want to calculate the Godambe Information matrix in R, which is defined as:
G(theta)= H(theta) J(theta)^-1 H(theta)
where J(theta) is the variability matrix and H(theta) is the sensitivity matrix.
I am not sure how to calculate these matrices in R for my likelihood function and the estimates obtained from the optim. Please help.
With respect to the following R implementation
Y %*% solve(chol(crossprod(Y)))
I can see it aims to perform cholesky decomposition over the Y'Y, and then multiplied by Y again.
What is it used for in the data processing? I do not quite understand the underlying mechanism.
I want to perform robust principal component analysis (PCA) on the correlation matrix. Namely, rrcov::PcaHubert.
I know that if I give to the function cor=TRUE, rrcov:CovMcd calculates the robust covariance and correlation matrix. How can I force the PCA to use the correlation matrix instead of the covariance matrix?
Thanks!
The phyl.vcv function in 'phytools' R package computes a phylogenetic trait variance-covariance matrix between two variables.
Can I use this matrix to compute a phylogenetic Pearson r value? If so, can this r-value be used in a t test (with n-2 df) to test the significance of the correlation?
Liam Revell posted a solution on his blog here with R code: http://blog.phytools.org/2017/08/pearson-correlation-with-phylogenetic.html