function [X,Y,c_est]=gram_demo(STAN,UNKN,rank,opts)
%Generalized Rank Annihilation Method as per Wilson, Sanchez, and Kowalski.
%
%INPUT
% STAN: Standardized matrix of known analyte concentration.
% UNKN: Mixture matrix of indeterminate constitution.
% rank: Estimated rank of the concatenated STAN and UNKN matrices
% opts: By default GRAM_WSK employs the concatenated matrices and
[STAN;UNKN]
% Setting options to any non-zero value employs the additive matrix
[STAN+UNKN] for GRAM.
%
%Output:
% X: Estimated, unit length, intrinsic profiles in the X order.
% Y: Estimated, unit length, intrinsic profiles in the Y order.
% c_est:Estimated relative constituent concentrations in UNKN.
%
% Initialization
if nargin = = 3
opts = 0;
end
%Compute row space and column space
if opts = = 0
[v,s,u]=svd([STAN,UNKN]',0); col_sp=u(:,1:rank);
[u,s,v]=svd([STAN;UNKN],0); row_sp=v(:,1:rank);
else
[u,s,v]=svd([STAN+UNKN],0); col_sp=u(:,1:rank);
row_sp=v:,1:rank);
end
%Reduce STAN and UNKN into square, full rank matrices and solve GEP
STAN=col_sp'*STAN*row_sp; UNKN=col_sp'*UNKN*row_sp;
[STAN_t,UNKN_t,q,z,Eig_vec]=qz(STAN,UNKN);
%Calculate X, Y, and c_est
Y=row_sp*pinv(Eig_vec)'; Y=Y./(ones(length(Y),1)*sum(Y.^2).^.5);
X=col_sp*(STAN+UNKN)*Eig_vec; X=X./(ones(length(X),1)*sum(X.^2).^.5);
c_est=diag(UNKN_t)./diag(STAN_t);
gram_demo.zip_DEMO
版权申诉
134 浏览量
2022-07-15
10:29:34
上传
评论
收藏 843B ZIP 举报
JonSco
- 粉丝: 75
- 资源: 1万+
最新资源
- 基于python后端开发框架
- seata-server 1.4.0和2.0.0
- signal-and-system信号与系统
- career.it.signals-systems信号与系统
- 基于TCP-IP实现的斗地主游戏(ARM-LINUX)C源码-95分以上课程设计
- Audio声卡驱动是一款系统音频处理的声卡驱动
- 面向计算机视觉的基础库,支持Linux、Windows及MacOS平台 提供了众多功能,包括基于PyTorch的通用训练框架等
- 基于LQR实现的车辆轨迹跟踪matlab源码+项目说明+超详细注释(高分项目)
- 视2.css
- Windows 10远程桌面服务配置文件rdpwrap10.0.22621.3593.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈