Causal Connectivity Analysis
Welcome to the Wiki site for the Causal Connectivity Analysis (CCA) MATLAB toolbox. For help on using the Wiki, please see the manual: The PBwiki Manual. This Wiki space is available for all users of the toolbox to share their experiences, bug reports, comments, improvements, etc.
Comments (25)
Anil Seth said
at 3:35 pm on Sep 30, 2009
Some users have been having problems running the demo, with the error "??? Undefined function or method 'marsaglia_normcdf' forinput arguments of type 'double'.". This means you need to recompile a mex file (a mex file is a C-file that can be called from within MATLAB). To do this, open MATLAB and type 'mex -setup'. This will give you a choice of compilers. Choose any (e.g., Lcc-win32). Then navigate to the 'utilities' subdirectory and type 'mex marsaglia_normcdf.c'. All should now be well. Today I've uploaded a new version of the manual explaining this, and a revised function ccaStartup.m that explicitly catches this problem.
Anil Seth said
at 4:48 pm on Sep 30, 2009
.. following on, I've uploaded the revised file ccaStartup.m to this wiki. You should find it under ''Pages and Files". Only download this if you downloaded the toolbox before sep 30 and are having the above problem.
(account deleted) said
at 8:44 pm on Oct 7, 2009
In section 3.2 Detrending and demeaning of the manual, it says that these two preprocessing steps should normally be applied. But at the end of the same section it also says that these steps are used for removing nonstationarity in the mean. Does this mean that these preprocessing steps should be applied to all data or just to data that is non-CS?
Anil Seth said
at 4:20 pm on Jan 4, 2010
New version of the toolbox just uploaded (dec 25 christmas edition!). Contains minor bug fixes plus new ways of testing stationarity using the KPSS test. Also, the ADF test is modified to deal with multitrial data.
goya said
at 10:10 am on Jan 20, 2010
Hello, I am having trouble in the item (ii) from the ccaStartup.m . The mex - setup offers me 3 options (1:*/f90opts.sh, 2:*/gccopts.sh, 3:*/mexopts.sh) to overwrite the mex files, but I have found no option or file related to utilities/marsaglia_normcdf.c . Any suggestions to solve the problem? Many thanks in advance.
Anil Seth said
at 4:36 pm on Jan 24, 2010
The first comment should still apply. mex -setup gives you a choice of compilers, choose any one (e.g., 'lcc'). Then, to compile the file you must explicitly type 'mex marsaglia_normcdf.m'. If there is still trouble, try deleting any existing marsaglia_normcdf files with a .mex extension and try again. Out of interest, what OS are you using?
goya said
at 11:27 am on Jan 25, 2010
The problem is actually that I find no marsaglia_normcdf files. When explicitly written as a command in SPM, it says marsaglia_normcdf.c "is not a normal file or does not exist". Actively searching for it I cannot even find the 'utilities' folder. What should be done?
The OS is Linux.
Joachim said
at 2:04 pm on Feb 3, 2010
It seems there is a bug in cca_pwcausal
If statflag is 1 it tries to execute
A = armorf_to_cca(A,nvar,nlags);
But the input A is not defined
Clark_d said
at 7:37 am on Mar 2, 2010
When running demo, I have this problem: "??? Undefined function or method 'center' for input arguments of type 'double'". What does this mean, could anybody help me, thanks?
Chris said
at 4:45 pm on Mar 7, 2010
Clark--I had the exact same problem. If you look in the cca_olss.m file you will see the 'center' function at the bottom, the last few lines. You will also notice there is already another function command in this file. Matlab will not recognize two different function calls within 1 m-file. So I created a new m-file, called cca_center.m, and copied the center code into that file. Then you just have to insert a command line in cca_olss.m, at the line right before where you see the 'center', to call the newly created cca_center.m function. Mine looked something like this: XC=cca_center(y). You will also have to change the current line in the cca_olss.m file that has 'center' in it. My change replaced all instances of 'center(y)' with XC (which would be the output from the newly created center function). After I made this change the demo worked great. If you are not too proficient with MATLAB I can list my code here if that would help--just let me know.
Clark_d said
at 9:09 am on Mar 8, 2010
Thank you very much, Chris! I put the function center in a new file named 'center', and it works.
Clark_d said
at 9:55 am on Mar 9, 2010
When we run "cca_permutebstrap_demo(GENFLAG)", we need the two files "temp.mat" and 'cca_plotcausality_spectral_temp'. But it seems they are missing in the toolbox. Does anybody have them or know where they are?
Thank you.
Anil Seth said
at 4:31 pm on Mar 9, 2010
Hi all. I think all bugs are now corrected. cca_pwcausal is fixed (joachim comment) and there is a dedicated function cca_center.m in the utilities file. All this is correct as of the dec 25 release. I will upload to this site a new version of cca_permutebstrap_demo.m.
paclink said
at 5:00 pm on Mar 9, 2010
I run the code on the Mac OS X, follow every step in the manual, and still have a problem with the mex file in the ccaStartup.
Or I should run the code on the Window instead?
Clark_d said
at 3:04 am on Mar 10, 2010
Mine is GCCA_toolbox_dec25, but there is no 'cca_center' or "temp.mat" or 'cca_plotcausality_spectral_temp'. How come?
paclink said
at 10:57 pm on Mar 10, 2010
I'm wondering if I want to use G-causality in the group-level analysis, should I consider each subject a single trial data for the GCCA?
I couldn't find how to analyze the connectivity of fMRI data at group level in the manual.
Anil Seth said
at 2:02 pm on Mar 12, 2010
(i) cca_center has now been uploaded to this wiki. (ii) you don't need 'temp.mat' or 'cca_plotcausality_spectral_temp' - the new version of cca_permutebstrap_demo does not need this files. (ii) group level fMRI is not something I'm familiar with; however, it would seem to make sense to analyze each subject separately using GCCA. There is a new paper in Neuroimage (with Steven Bressler) that addresses some of these issues: http://dx.doi.org/10.1016/j.neuroimage.2010.02.059. (iii) I have no experience of the Mac OS environment - sorry about that.
Jokel said
at 11:06 pm on Mar 21, 2010
I also have problems using the toolbox on mac (2GHz) running Mac OS X 10.6.2 due to the above describe problem. Trying to compile marsaglia_normcdf.c leads also in the above described error message. Could maybe anyone provide a pre-compiled version for mac?
Ulrich Reinacher said
at 6:57 pm on May 4, 2010
To those with problems compiling: Do you by any chance run 64-bit versions of MATLAB? Those come without a complimentary 64-bit c-compiler. <a href="http://www.mathworks.com/support/compilers/R2010a/index.html">Here</a> you can find the list of supported compilers for your system and MATLAB version.
Ulrich Reinacher said
at 7:18 pm on May 4, 2010
On the problem with center in cca_ols: There seems to be a control character (end of file?) in line 28 of cca_ols, which the MATLAB Editor only represents as whitespace. That is the only reason that center() was not recognized as subfunction. If you clear the line you will immediately see the changed syntax highlighting. Code folding and m-lint messages will appear. I have not run a dependency check yet, to see whether the new function cca_center() is needed elsewhere. On the subject of cca_ols: A missed % in line 4 cuts the help output short.
ana said
at 11:35 pm on Jun 2, 2010
Hi, I have to admit I don’t know very much about this topic, but I need to apply this method of causality for some calcium signals in beta cells, as soon as possible.
I tried to use your Matlab codes and fallow your instructions, but I have problems.
If I use the data I have, the code tells me that is not CS, so, I differenced it, and after I run the code again, it says the data is CS, but it fails the consistency tests etc.
I also tried to resample the data, because the original one has long time series (6*3845; 6 cells (variables) and 3845 time steps (observations)). Still, the same problems.
Do I have to pre-process the data? How do I do this?
Do you think I can apply your routine for this type of data?
Thank you...
acercyc said
at 4:40 am on Jun 4, 2010
1. In cca_pajek.m
Line 40 the script
if(~iscell(nodenames{i}))
could be modified to
if(~iscell(nodenames(i)))
2. In the GCCA_manual.pdf
page 13: the detrend finction:
x = detrend(x);
should be modified to
x = cca_detrend(x);
ana said
at 11:34 am on Jun 5, 2010
I did that. Still is not working...
Rick said
at 6:28 pm on Jun 9, 2010
Has anyone come up with a consistent way of dealing with non-stationarity over multiple sets of data? Has anyone tried curve-fitting before running the toolbox's methods of dealing with non-stationarity? The idea is to filter the data the least amount and in a consistent way. If so, I would like to hear your thoughts or any input at all.
-Ricky
srivas said
at 1:33 pm on Sep 20, 2011
Hello Anil and all,
Wondering if anybody can shed light on the undocumented 'cca_granger_regress_optimized.m' function, which seems to be a much faster version of cca_granger_regress.m. Are the two versions functionally equivalent? If so, is there a way to have a optimized alternative to cca_granger_regress_mtrial.m? This 'unoptimised' function takes a very long time (in the order of days) to compute granger causalities for a dataset 20 variables, and 20 realisations with 3500 observations each, for a model order of 50.
Thanks for any pointers,
Srivas.
You don't have permission to comment on this page.