Undefined function 'bst_vgarch' when running bst_granger

Hi,

When I tried to run bst_granger on Matlab(2012b), I always got the following message

[connectivity, pValue, connectivityV, pValueV, X, Y] = bst_granger(sinks, sources, 20, inputs)
Undefined function 'bst_vgarch' for input arguments of type 'char'.

Error in bst_granger (line 262)
[W, C, D, R, S, information, rhoBest] = ... % bivariate ARCH modeling

all the parameters were set following the examples in the code:
% [inMean, inVariance] = bst_granger(X, Y, 5, inputs);
% [inMean, inVariance] = bst_granger(X, , 5, inputs); % every pair in X
% [inMean, inVariance] = bst_granger(X, , 20, inputs); % more delays in AR
% inputs.nTrials = 10; % use trial-averaged covariances in AR estimation
% inputs.standardize = true; % zero mean and unit variance
% inputs.flagFPE = true; % allow different orders for each pair of signals
% inputs.lag = 3; % estimate causality in variance using lag-3 ARCH model
% inputs.flagELM = true; % find the optimal lag rather than always given lag
% inputs.rho = 50; % parameter to tune estimation of ARCH model
% % higher -> more stability, much slower
% % lower -> might not converge, much faster
% % go in multiples of 5 up or down as desired
% % 50 is a good start for rho

I have updated my Brainstorm to the latest version and still could not found the bst_vgarch function in the toolbox.

Thank you very much!
Lu

Hello

Calling bst_granger.m from a script is not a supported feature of Brainstorm.
Use it at your own risks.

In attachment, the function bst_vgarch, with no guarantee of results.
bst_vgarch.m (82.5 KB)

Francois

Hi Francois,

I would like to try and implement bst_granger.m from script. Could you please reattach the bst_vgarch.m? The link is no longer available.

Also, why is it recommended that we don't call this function in script?

Best,

Jae

Here it is:
https://www.dropbox.com/s/xoapu1jureq3uo3/bst_vgarch.m?dl=0

Also, why is it recommended that we don't call this function in script?

It is not part of Brainstorm, it might not be working correctly, the authors do not work with us anymore and do not provide any support for it.

Thank you Francois, I will try to work with the code. I have a question: How does the code work through the brainstorm GUI if it doesn't have bst_vgarch.m? I guess I'm confused on the process of bst_granger.m

Not all the combinations of inputs require this bst_vgarch function.
If you want to see what happens when calling bst_granger from the Brainstorm interface, place a breakpoint at the beginning of the function and run the corresponding process from the GUI. Watch a tutorial about the Matlab debugger first if you don't know how to use it.