Correlation matrix using opencl - opencl

How can we efficiently implement calculation of correlation matrix (pearson correlation) using opencl? Can anyone help me with the kernel function?

Related

Simulating data using gaussian copula when dealing with non-positive definite matrix

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

How to calculate Godambe information matrix in R?

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.

regarding the cholesky decomposition of a crossproduct of a matrix

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.

use correlation matrix in robust PCA functions R

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!

Can I use phyl.vcv function in "phytools" to compute a phylogenetic Pearson r

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

Resources