MBB-team / VBA-toolbox

The VBA toolbox
GNU General Public License v3.0
129 stars 67 forks source link

BUG: f_dcm_extension - only Cr defined #66

Closed SRSteinkamp closed 5 years ago

SRSteinkamp commented 5 years ago

Dear all,

I was testing in Behavioural DCM what happens if only the Cr matrix is defined. This leads to the following error:

Deriving prior's sufficient statistics ... 0.00 % Error: could not initialize VB scheme : check function "easykron" at line 96

The error happens in f_dcm_extension and happening in line 66. dfdp(indhC,:) = inF.dhC'*easykron(ut,n);

Easykron, however, needs 3 input parameters:

function B=easykron(X,nx,n)
B = zeros(n*nx,n);
  idx = 1:n:(n*nx+eps);
  for k = 1:n  
    B(idx,k) = X;
    idx = idx+1;
  end

Unfortunately I am really unsure about how to fix it, as (to be frank) I have only a slight understanding about what is happening there. Just by looking at the variables shape, I think something like: easykron(ut, nu, nr) could be a fix.

lionel-rigoux commented 5 years ago

Thanks for reaching out,

There is indeed a missing argument. I will check this closely and issue a patch today.

lionel-rigoux commented 5 years ago

After some quick checks, your solutions seems correct: easykron(ut,nu,nr)

lionel-rigoux commented 5 years ago

This is fixed by #67 in the development branch. The fix will be ported to the master branch in the next release.