From e8a193bbfbe4eab7d31c5dacd8481a06907db669 Mon Sep 17 00:00:00 2001 From: George Perendia Date: Wed, 20 Oct 2010 11:44:45 +0100 Subject: [PATCH] Track #21: Add partial information: Correcting bug stemming from the differences in QZ calculation under Octave and Matlab: modified PI_gensys to use C.Sims' Lapack zgges based qzcomplex() qz decomposition routine under Octave which gives nearly identical complex results to Matlab QZ (except for transpose of q matrix and few sign changes in the output matrices) --- matlab/partial_information/PI_gensys.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/matlab/partial_information/PI_gensys.m b/matlab/partial_information/PI_gensys.m index ef181b385..3094bb7cf 100644 --- a/matlab/partial_information/PI_gensys.m +++ b/matlab/partial_information/PI_gensys.m @@ -153,7 +153,16 @@ end G0pi=eye(n+FL_RANK+NX); try - [a b q z v]=qz(G0pi,G1pi); + % In Matlab: [aa bb q z v w] = qz(a,b) s.t. qaz = aa, qbz = bb % + % In Octave: [aa bb q z v w] = qz(a,b) s.t. q'az = aa, q'bz=bb % + % and qzcomplex() extension based on lapack zgges produces same + % qz output for Octave as Matlab qz() does for Matlab thus: + if exist('OCTAVE_VERSION') + [a b q z]=qzcomplex(G0pi,G1pi); + q=q'; + else + [a b q z]=qz(G0pi,G1pi); + end catch try lerror=lasterror;