uufct.m (408B)
1 function uu=uufct(beta,X,mname,param); 2 3 % uufct.m The function to be minimized u'u 4 % It calls the user-defined function mfct(beta,x) 5 % 6 % Chad 5/18/04 I'm not sure this works -- fminsearch doesn't seem to pass mname... 7 8 [T col]=size(X); 9 y=X(:,1); 10 x=X(:,2:col); 11 12 %% u=y-mfct(beta,x); 13 if ~exist('param'); 14 eval(['u=y-' mname '(beta,x);']); 15 else; 16 eval(['u=y-' mname '(beta,x,param);']); 17 end; 18 uu=u'*u; 19