Skip to content
New issue

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

Is matrix augmentation supported #35

Open
aminsagar opened this issue Sep 1, 2020 · 12 comments
Open

Is matrix augmentation supported #35

aminsagar opened this issue Sep 1, 2020 · 12 comments

Comments

@aminsagar
Copy link

Hello.

Is matrix augmentation supported like in MATLAB MCR-ALS? If not, is there a straightforward way to extend the code to allow row and column augmented matrices?

Thanks.
Amin.

@CCampJr
Copy link
Collaborator

CCampJr commented Sep 1, 2020

@aminsagar Thanks for the question!

I'm not 100% familiar with the row- and column-wise data augmentation in the MCR-ALS package.

  • Do you have further information on what that means and your problem that needs it.
  • I have no doubt that the code could be extended to do it.

Thanks!

@aminsagar
Copy link
Author

Thanks for the response.
I collect data using different techniques and different experiments. Generally, in MCR-ALS, data from different techniques, i.e. matrices with same concentrations but different spectra are joined row-wise, while data from different experiments, i.e different concentration but common spectra is joined column-wise. All this data augmentation is done to reduce ambiguity of the solutions.
Screenshot_2020-09-01 mcr_2005 ppt - MCR_2005 pdf

@CCampJr
Copy link
Collaborator

CCampJr commented Sep 1, 2020

@aminsagar Great description.

I can see possible ways to implement it -- let me check into that.

I'll see what I can do to make that happen. Do you have the same constraints on your augmented matrices (e.g., sum-to-one, or non-negativity)?

@aminsagar
Copy link
Author

Thanks. It would be awesome if this could be implemented.
I use non-negativity on all the matrices, for both concentrations and spectra. I actually don't use sum-to-one on all the matrices but using it is not essential for my problem.

Again, thanks a lot.

@CCampJr
Copy link
Collaborator

CCampJr commented Sep 8, 2020

@aminsagar

Sorry it's going to take a bit to implement this: just busy with work. If you have any coding expertise and want to take a crack at it, feel free -- always looking for collaborators.

Thanks again for bringing this to my attention: I wasn't aware of this "data augmentation" capabilities.

@aminsagar
Copy link
Author

@CCampJr
No problem. I will try to implement a simple version of matrix augmentation first (all matrices having the same set of restraints) to see how hard it is for me.

@aminsagar
Copy link
Author

@CCampJr
Sorry, I wanted to say I would try to implement a simple version with different restraints in only one dimension.

@HaasCP
Copy link

HaasCP commented Feb 19, 2021

@CCampJr @aminsagar

Is there any follow-up/new information on this issue?

@CCampJr
Copy link
Collaborator

CCampJr commented Feb 19, 2021

@CCampJr @aminsagar

Is there any follow-up/new information on this issue?

@HaasCP I haven't heard anything. Are you, too, interested in this?

@HaasCP
Copy link

HaasCP commented Feb 19, 2021

@CCampJr
I might be but I am not quite sure, yet. Just looking in the pros and cons of implementing this package or using the R/MATLAB packages.

@CCampJr
Copy link
Collaborator

CCampJr commented Feb 19, 2021

@HaasCP Gotcha.

This package is a lot more flexible (matrix augmentation withstanding) than the MATLAB one because one can choose any algorithm for regression and constraints are easy to implement. That being said if the MATLAB one can do what you want then it's a very solid choice.

Admittedly, I've been too busy to take a crack at coding data augmentation, but I hope to get to it soon.

@aminsagar
Copy link
Author

@HaasCP @CCampJr
I tried to modify the code but it was beyond my abilities atleast in the time frame I could dedicate to this. I completely agree with @CCampJr on the advantages of the package.
While I couldn't modify pyMCR, I was able to write the code for decomposition with matrix augmentation rather easily using NNLS and some simple restraints that I require. As you know, the only requirement is to separate the decomposition and determination of convergence. Conceptually, it goes like this.
while (number of iterations < max interations)
for i in range (1,number of matrices)
do NNLS for ith matrix
apply restraints on ith matrix
calculate residuals for the augmented matrix (d - augmented concentrations * augmented spectra)
determine convergence

What I have works quite well for my problem but is not general at all.
Unfortunately, I don't think I will be able to modify pyMCR to support this. Hoping @CCampJr gets some time to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants