Comments (6)
Either the covariance matrix is not positive definite or there is an accumulated floating-point error. If you could provide data sample, I'll look into it.
from multivariatestats.jl.
Thanks for getting back to me! I just checked, the covariance matrix seems to be positive definite, so it might be accumulated floating point errors. I have attached an example matrix as a jld file but Github doesn't allow uploads of that file type so I added .zip to the file name i.e. don't try to extract it, just remove the .zip from the file name. Thanks!
example_matrix.jld.zip
.
from multivariatestats.jl.
It that a 19-dimensioanal data? If it is the case I think you incorrectly passed your data to a fit
function.
All functions in this package accept column-major order data. So if you pass your matrix as it is (size 2457x19), you'll get 19 records of 2457 dims which definitely results in a non-positive definite covariance matrix.
If it is not the case just transpose your input.
from multivariatestats.jl.
Hmm I'm not sure I understand. My input data has 19 samples (as columns) with 2457 features (as rows) and I checked for positive definiteness by doing eigvals(cov(X))
which returned a set of all positive eigenvalues (the smallest one was ~0.002).
from multivariatestats.jl.
This package uses data in a column-major order means which means that in a data matrix, each column corresponds to a sample/observation, while each row corresponds to a feature (variable or attribute or dimension).
If the matrix size is 2457x19 then you have a 19 2457-dimensional samples. By default, cov
function computes covariance along the matrix dimension 1, cov(X, dims=1)
, which results in the covariance matrix of size 19x19, because row is first matrix dimension and we compute/fold along this dimension. This is fine if our samples are rows in the data matrix, which is not in our case.
So, you call cov(X, dims=2)
for data in column-major order and get proper 2457x2457 covariance matrix, which in your case in not positive definite.
julia> count(eigvals(cov(X, dims = 2)) .< 0)
1223
from multivariatestats.jl.
Oh dang, I misunderstood! Thanks for your help!!
from multivariatestats.jl.
Related Issues (20)
- Multiclass LDA bounds error HOT 3
- Any plan for functional PCA? HOT 1
- 1.0 Release
- `transform` and `reconstruct` HOT 1
- Request for adjoint support in MulticlassLDA HOT 4
- show function calls show(io,M), not show(io, MIME, M) HOT 1
- error while fitting PCA model HOT 2
- LDA docs clarification HOT 5
- KernelPCA reconstruct problem HOT 1
- fitting `SubspaceLDA models fails.
- `predict` for `MulticlassLDA` is throwing error HOT 1
- Mutating labels when training MulticlassLDA HOT 1
- Isotonic Regression question HOT 1
- MethodError: no method matching fit(::Type{MDS}, ::Adjoint{Float64, Matrix{Float64}} HOT 3
- Add Citation.bib and DOI with zenodo?
- Bugs in isotonic regression ? HOT 1
- CCA results do not match sklearn.cross_decomposition.CCA HOT 1
- Can I fix the number of number of factors (i.e., output dimension)?
- Inferred `outdim` for ICA sometimes fails but without an informative explanation
- LDA Printing flipped in y and x axis data on docs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multivariatestats.jl.