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
traceABtrans.m
%trace of A times B'
%  Mex version to compute the trace of the multiplication of A and B' 
%  
%  The function uses the trace trick to speed up estimation times:
%  trace(A*B')=sum(sum(A.*B))
%
% INPUT:
%   A: NxK matrix
%   B: NxK matrix
%
% OUTPUT:
%   tr : the trace of A times B'
%
% WARING: for speed reasons the mex version of this function skips all
% checks involving the size of the matrices, these checks should be
% implemented in the calling function
% (c) Naveed Ejaz 2013 n.ejaz@ucl.ac.uk
%
% See also traceAB
back to top