We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can't figure out how use CCA in this package
function canonicalcor(x::AbstractMatrix, y::AbstractMatrix) ma = inv(cov(x))*cov(x, y)*inv(cov(y))*cov(y,x) mb = inv(cov(y))*cov(y, x)*inv(cov(x))*cov(x,y) evx = eigvecs(ma) evy = eigvecs(mb) abs(cor(x*evx[:, end], y*evy[:, end])) #[-cor(x*evx, y*evy) for (evx, evy) in zip(eachcol(evx), eachcol(evy))] end canonicalcor(x, y)
I just copied the formula from wikiepdia and it agrees with the results in R.
The text was updated successfully, but these errors were encountered:
Let X and Y be two samples of dimension 5 and 6 correspondingly. Package accepts data in column-major order, so samples are columns.
julia> size(X) (5, 1000) julia> size(Y) (6, 1000) julia>M = fit(CCA,X,Y; method=:svd, outdim=1) CCA (xindim = 5, yindim = 6, outdim = 1) julia> a = xprojection(M); julia> b = yprojection(M); julia> correlations(M) 1-element Array{Float64,1}: 0.9921900042447322 julia> cor(X'a, Y'b) # need to transpose because col-major order 1×1 Array{Float64,2}: 0.992190004244732
Sorry, something went wrong.
No branches or pull requests
I can't figure out how use CCA in this package
I just copied the formula from wikiepdia and it agrees with the results in R.
The text was updated successfully, but these errors were encountered: