From: <ha...@us...> - 2010-03-20 19:50:39
|
Revision: 7081 http://octave.svn.sourceforge.net/octave/?rev=7081&view=rev Author: hauberg Date: 2010-03-20 19:50:32 +0000 (Sat, 20 Mar 2010) Log Message: ----------- Use 'diag (A)*B' instead of 'dmult (A, B)' Modified Paths: -------------- trunk/octave-forge/main/econometrics/inst/poisson.m trunk/octave-forge/main/econometrics/inst/poisson_moments.m trunk/octave-forge/main/econometrics/inst/scale_data.m Modified: trunk/octave-forge/main/econometrics/inst/poisson.m =================================================================== --- trunk/octave-forge/main/econometrics/inst/poisson.m 2010-03-20 19:44:02 UTC (rev 7080) +++ trunk/octave-forge/main/econometrics/inst/poisson.m 2010-03-20 19:50:32 UTC (rev 7081) @@ -20,6 +20,6 @@ x = data(:,2:columns(data)); lambda = exp(x*theta); log_density = -lambda + y .* (x*theta) - lgamma(y+1); - score = dmult(y - lambda,x); + score = diag (y - lambda) * x; if (otherargs{1} == 1) score = "na"; endif # provide analytic score or not? endfunction Modified: trunk/octave-forge/main/econometrics/inst/poisson_moments.m =================================================================== --- trunk/octave-forge/main/econometrics/inst/poisson_moments.m 2010-03-20 19:44:02 UTC (rev 7080) +++ trunk/octave-forge/main/econometrics/inst/poisson_moments.m 2010-03-20 19:50:32 UTC (rev 7081) @@ -22,5 +22,5 @@ w = data(:, k+2:columns(data)); lambda = exp(x*theta); e = y ./ lambda - 1; - m = dmult(e, w); + m = diag(e) * w; endfunction Modified: trunk/octave-forge/main/econometrics/inst/scale_data.m =================================================================== --- trunk/octave-forge/main/econometrics/inst/scale_data.m 2010-03-20 19:44:02 UTC (rev 7080) +++ trunk/octave-forge/main/econometrics/inst/scale_data.m 2010-03-20 19:50:32 UTC (rev 7081) @@ -38,7 +38,7 @@ # don't take out mean if the column is a constant, to preserve identification b = b .* test; b = A*b; - bb = dmult(b, ones(k,n))'; + bb = (diag(b) * ones(k,n))'; endif zz = z*A + bb; scalecoefs = {A,b}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |