home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 9.ddi / IDENT.DI$ / TH2PAR.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  804 b   |  26 lines

  1. function [par,P,lam]=th2par(th);
  2. %TH2PAR converts the theta-format to parameters and covariance matrix;
  3. %
  4. %    [PAR,P,LAM]=th2par(TH)
  5. %
  6. %    TH: The model defined in the THETA-format (see help theta)
  7. %    PAR: The parameter vector in THETA (nominal or estimated
  8. %         values of the free parameters)
  9. %    P:   The covariance matrix of the estimated parameters
  10. %    LAM: The variance (covariance matrix) of the innovations
  11.  
  12. %    L. Ljung 10-2-90
  13. %    Copyright (c) 1990 by the MathWorks, Inc.
  14. %    All Rights Reserved.
  15.  
  16. [nr,nc]=size(th);
  17. if isthss(th), nd=th(1,5);else nu=th(1,3);
  18. nd=th(1,4)+sum(th(1,5:4+nu))+th(1,5+nu)+th(1,6+nu)+sum(th(1,7+nu:6+2*nu));end
  19.  
  20. par=th(3,1:nd);
  21.  
  22. if nr>=3+nd,P=th(4:3+nd,1:nd);else P=[];end
  23. if isthss(th), rarg=th(1,6);
  24. lam=th(4+nd+rarg:nr,1:th(1,4)); else lam=th(1,1);end
  25.  
  26.