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

Issue while estimate number of independent components #10

Open
facazevedo opened this issue Jan 22, 2023 · 0 comments
Open

Issue while estimate number of independent components #10

facazevedo opened this issue Jan 22, 2023 · 0 comments

Comments

@facazevedo
Copy link

facazevedo commented Jan 22, 2023

I was trying to estimate the number of IC components using the "Standard ICA/IVA" option and the MDL (i.i.d. Sampling) but I got an error "Unrecognized function or variable "dim_n". Upon investigating the issue, I found out that the problem lied in the snippet of the function icatb_estimate_dimension.m:

%% Perform variance normalization
if verbose
    fprintf('\n Performing variance normalization ...');
end

for n = 1:size(data, 2)
    data(:, n) = detrend(data(:, n), 0) ./ std(data(:, n));
end

%% (completed)

What happened was that a few of the columns in my dataset had zero std, which made the data to contain columns of nans, which causes svd to fail later. To circumvent that, I added two lines of code that removed the columns of nan's and redefined tdim:

%% Perform variance normalization
if verbose
    fprintf('\n Performing variance normalization ...');
end

for n = 1:size(data, 2)
    data(:, n) = detrend(data(:, n), 0) ./ std(data(:, n));
end

data = data(:, ~all(isnan(data))); % modfred
tdim = size(data, 2); % modfred

%% (completed)

The code seems be able to estimate the PC's but I get the error at the end:

121 eigen values are less than or equal to machine precision

Best.

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

1 participant