=SET NOECHO PROC QR ** INPUTS: X_ N_ K_ ** OUTPUTS: Q_ R_ ** IMPORTANT: THIS CALLS THE HH PROC WHICH MUST BE PRELOADED * compute the P matrix for the first column matrix Q_=IDEN(N_) matrix R_=X_ DO #=1,K_ gen1 fr_=N_+1-# copy R_ a_ / frow=#;N_ fcol=#;# trow=1;fr_ tcol=1;1 exec HH ?del a_ * save it as P#_ matrix P#_=P_ *print P#_ matrix P_=IDEN(N_) copy P#_ P_ / frow=1;fr_ fcol=1;fr_ trow=#;N_ tcol=#;N_ matrix Q_=Q_*P_ matrix R_=P_*R_ * get the bottom of the second column of PX ENDO * check it print Q_ R_ matrix check_=Q_*R_ print check_ PROCEND =SET ECHO