https://github.com/jdiedrichsen/pcm_toolbox
Raw File
Tip revision: 4e290a8b2c0d0820f868b7bcb60a3da7bb30e6ee authored by Jörn Diedrichsen on 26 April 2023, 01:59:24 UTC
Update pcm_estimateRegression.m
Tip revision: 4e290a8
pcm_prepFreeModel.m
function M=pcm_prepFreeModel(M); 
% function M=pcm_prepFreeModel(M); 
% Prepares the free model by calculating vectorization of Cholensky matrix 
% Speeds up subsequent computation 
if (~isfield(M,'numCond'))
    error('need to provide numCond as a field'); 
end; 
M.indx         = find(tril(true(M.numCond))); 
[M.row,M.col]  = ind2sub([M.numCond M.numCond],M.indx);
M.numGparams   = length(M.indx); 
back to top