script_demo.m

来自「基于Informax判据的ICA算法」· M 代码 · 共 46 行

M
46
字号
% Demo script
% version 1.0


% Generate data
K_true=6 % number of sources
interval=[2:10]; % Number of IC components interval to search

% Generate mixed signals from artificial super Gaussian sources and mixing matrix
Atrue=randn(20,K_true);
Strue=sinh(randn(K_true,1000))/.1;
X=Atrue*Strue;



% - 1th Part - Finding best model wrt. number of components using BIC

%BIC
P=icaML_bic(X,interval,1);

[most_prop,most_prop_k]=max(P);
most_prop
most_prop_k=interval(most_prop_k)

% Draw
figure(1)
clf
bar(interval,P);
drawnow;



% - 2nd Part - finding ICA components using BIC estimat of K (number of source components)

% ICA
[S,Aica,U] = icaML( X , most_prop_k , [] , 1);
A = U(:,1:most_prop_k) * Aica;

% Draw first two IC components in scatterplot
figure(2)
clf
plot(S(1,:),S(2,:),'.')
drawnow;


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?