From: <par...@us...> - 2012-05-15 20:01:27
|
Revision: 10446 http://octave.svn.sourceforge.net/octave/?rev=10446&view=rev Author: paramaniac Date: 2012-05-15 20:01:20 +0000 (Tue, 15 May 2012) Log Message: ----------- control-devel: minor changes Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/arx.m Modified: trunk/octave-forge/extra/control-devel/inst/arx.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-15 15:22:00 UTC (rev 10445) +++ trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-15 20:01:20 UTC (rev 10446) @@ -26,6 +26,8 @@ function sys = arx (dat, na, nb) + ## TODO: delays + if (nargin != 3) print_usage (); endif @@ -97,9 +99,10 @@ function theta = __theta__ (phi, y, i, n) if (numel (phi) == 1) # single-experiment dataset + ## use "square-root algorithm" A = horzcat (phi{1}, y{1}(n(i)+1:end, i)); # [Phi, Y] R0 = triu (qr (A, 0)); # 0 for economy-size R (without zero rows) - R1 = R0(1:end-1, 1:end-1); # R1 is triangular - can we exploit this in R1\R2 + R1 = R0(1:end-1, 1:end-1); # R1 is triangular - can we exploit this in R1\R2? R2 = R0(1:end-1, end); theta = __ls_svd__ (R1, R2); # R1 \ R2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |