Back to the main page.
Bug 3224 - :Size inputs error must be integers: error in non-parametric spectral factorization of partial directed coherence
Status | CLOSED WONTFIX |
Reported | 2016-12-19 21:08:00 +0100 |
Modified | 2019-08-10 12:40:46 +0200 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P5 minor |
Assigned to: | |
URL: | |
Tags: | |
Depends on: | 3018 |
Blocks: | |
See also: |
- 2016-12-19 21:08:49 +0100
Created attachment 820 reduced data subset that still produces the error. I've encountered a small problem trying to calculate partial directed coherence (FT version 20160419). When I run the code, I get the following warning: Warning: when performing non-parametric spectral factorization, the frequency axis should ideally start at 0, zero padding the spectral density And then the following error: Error using zeros Size inputs must be integers. Error in sfactorization_wilson (line 63) S = cat(3, zeros(size(S,1), size(S,1), npad), S); After some digging, I found that npad is not a whole number. My frequency vector for the frequency analysis was 1:2:200, so npad is 1/2. In the short term, I can obviously redo the frequency analysis with a frequency vector starting at zero. It would be great if the padding could either a) round npad appropriately or b) give a relevant error if the spectral factorization requires both a value for frequency zero AND regular frequency spacing. I haven't had a chance to look too closely at the math to tell which of these solutions is appropriate. The full dataset is too big to attach here, but I attached a smaller subset that still reliably produces the error. If you run the following code, you should see it: cfg.method = 'pdc'; pdcdata = ft_connectivityanalysis(cfg,csdfreq); Thanks!
Jan-Mathijs Schoffelen - 2016-12-20 09:00:05 +0100
spectral factorization only works if the input frequency data indeed contains a valid frequency sampling. Typically, this should be 0:rayleighfrequency:Nyquist.
Jan-Mathijs Schoffelen - 2016-12-20 09:03:36 +0100
I agree that some instructive error message would be useful. Please feel free to come with a suggestion: this can be best done through a pull request for the fieldtrip repo on github: https://github.com/fieldtrip/fieldtrip.git With respect to the padding I think that it's the user's responsibility to define an appropriate padding. In the context of npsf, the more the better (+multitaper smoothing)
Jan-Mathijs Schoffelen - 2016-12-23 09:00:45 +0100
Any update on this? Otherwise I suggest to close
Jan-Mathijs Schoffelen - 2017-01-01 12:51:10 +0100
Any update on this? Otherwise I suggest to close
Jan-Mathijs Schoffelen - 2017-01-04 14:16:13 +0100
Due to the lack of current interest, I consider it low priority, and close for now.
Robert Oostenveld - 2019-08-10 12:34:36 +0200
This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on https://github.com/fieldtrip/fieldtrip/issues.