function Theta = MIMO_ML_ExtractParam(DeltaParam, OldTheta, Sel); Extracts the parameter update Theta from the variation of the free parameters in DeltaParam Output parameter Theta = new estimate plant, noise, and initial conditions parameters structure with fields 'A', 'B', 'Ig' Theta = struct('A',[],'B',[], 'Ig', []) Theta.A = 1 x (OrderA+1) Theta.A(r) = coefficient a(r-1) of Omega^(r-1) Theta.B = ny x nu x (OrderB+1) Theta.B(i,j,r) = coefficient b(i,j,r-1) of Omega^(r-1) Theta.Ig = ny x (OrderIg+1) Theta.Ig(i,r) = coefficient ig(i,r-1) of Omega^(r-1) Input parameter DeltaParam = column vector containing the free model parameters, size: number of free parameters x 1 OldTheta = previous estimate plant, noise, and initial conditions parameters structure with fields 'A', 'B', 'Ig' OldTheta = struct('A',[],'B',[], 'Ig', []) OldTheta.A = 1 x (OrderA+1) OldTheta.A(r) = coefficient a(r-1) of Omega^(r-1) OldTheta.B = ny x nu x (OrderB+1) OldTheta.B(i,j,r) = coefficient b(i,j,r-1) of Omega^(r-1) OldTheta.Ig = ny x (OrderIg+1) OldTheta.Ig(i,r) = coefficient ig(i,r-1) of Omega^(r-1) Sel = structure with fields 'A', 'B', 'Ig' Sel = struct('A',[],'B',[], 'Ig', []) Sel.A = 1 x (OrderA+1) Sel.A(r) = 1 if coeff. a(r-1) is unknown Sel.A(r) = 0 if coeff. a(r-1) = 0 Sel.B = ny x nu x (OrderB+1) Sel.B(i,j,r) = 1 if coeff. b(i,j,r-1) is unknown Sel.B(i,j,r) = 0 if coeff. b(i,j,r-1) = 0 Sel.Ig = ny x (OrderIg+1) Sel.Ig(i,r) = 1 if coeff. ig(i,r-1) is unknown Sel.Ig(i,r) = 0 if coeff. ig(i,r-1) = 0 Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, November 2009 All rights reserved. Software can be used freely for non-commercial applications only.
0001 function Theta = MIMO_ML_ExtractParam(DeltaParam, OldTheta, Sel); 0002 % 0003 % function Theta = MIMO_ML_ExtractParam(DeltaParam, OldTheta, Sel); 0004 % 0005 % Extracts the parameter update Theta from the variation of the 0006 % free parameters in DeltaParam 0007 % 0008 % Output parameter 0009 % 0010 % Theta = new estimate plant, noise, and initial conditions parameters 0011 % structure with fields 'A', 'B', 'Ig' 0012 % Theta = struct('A',[],'B',[], 'Ig', []) 0013 % Theta.A = 1 x (OrderA+1) 0014 % Theta.A(r) = coefficient a(r-1) of Omega^(r-1) 0015 % Theta.B = ny x nu x (OrderB+1) 0016 % Theta.B(i,j,r) = coefficient b(i,j,r-1) of Omega^(r-1) 0017 % Theta.Ig = ny x (OrderIg+1) 0018 % Theta.Ig(i,r) = coefficient ig(i,r-1) of Omega^(r-1) 0019 % 0020 % Input parameter 0021 % 0022 % DeltaParam = column vector containing the free model parameters, 0023 % size: number of free parameters x 1 0024 % 0025 % OldTheta = previous estimate plant, noise, and initial conditions parameters 0026 % structure with fields 'A', 'B', 'Ig' 0027 % OldTheta = struct('A',[],'B',[], 'Ig', []) 0028 % OldTheta.A = 1 x (OrderA+1) 0029 % OldTheta.A(r) = coefficient a(r-1) of Omega^(r-1) 0030 % OldTheta.B = ny x nu x (OrderB+1) 0031 % OldTheta.B(i,j,r) = coefficient b(i,j,r-1) of Omega^(r-1) 0032 % OldTheta.Ig = ny x (OrderIg+1) 0033 % OldTheta.Ig(i,r) = coefficient ig(i,r-1) of Omega^(r-1) 0034 % 0035 % Sel = structure with fields 'A', 'B', 'Ig' 0036 % Sel = struct('A',[],'B',[], 'Ig', []) 0037 % Sel.A = 1 x (OrderA+1) 0038 % Sel.A(r) = 1 if coeff. a(r-1) is unknown 0039 % Sel.A(r) = 0 if coeff. a(r-1) = 0 0040 % Sel.B = ny x nu x (OrderB+1) 0041 % Sel.B(i,j,r) = 1 if coeff. b(i,j,r-1) is unknown 0042 % Sel.B(i,j,r) = 0 if coeff. b(i,j,r-1) = 0 0043 % Sel.Ig = ny x (OrderIg+1) 0044 % Sel.Ig(i,r) = 1 if coeff. ig(i,r-1) is unknown 0045 % Sel.Ig(i,r) = 0 if coeff. ig(i,r-1) = 0 0046 % 0047 % 0048 % Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, November 2009 0049 % All rights reserved. 0050 % Software can be used freely for non-commercial applications only. 0051 % 0052 0053 nu = size(OldTheta.B,2); 0054 ny = size(OldTheta.B,1); 0055 0056 % coefficients polynomial A 0057 sumA = sum(Sel.A); 0058 DeltaA = zeros(1,length(Sel.A)); 0059 lower = 1; 0060 upper = sumA; 0061 DeltaA(Sel.A == 1) = DeltaParam(lower:upper).'; 0062 Theta.A = OldTheta.A + DeltaA; 0063 0064 % coefficients ny x nu matrix polynomial B 0065 Theta.B = zeros(size(OldTheta.B)); 0066 for jj = 1:nu 0067 for ii = 1:ny 0068 sumB = sum(Sel.B(ii,jj,:)); 0069 DeltaB = zeros(1, 1, length(Sel.B(ii,jj,:))); 0070 lower = upper + 1; 0071 upper = lower + sumB - 1; 0072 DeltaB(1, 1, Sel.B(ii,jj,:) == 1) = DeltaParam(lower:upper).'; 0073 Theta.B(ii,jj,:) = OldTheta.B(ii,jj,:) + DeltaB; 0074 end % jj 0075 end % ii 0076 0077 % coefficients ny x 1 vector polynomial Ig 0078 Theta.Ig = zeros(size(OldTheta.Ig)); 0079 for ii = 1:ny 0080 sumIg = sum(Sel.Ig(ii,:)); 0081 DeltaIg = zeros(1, length(Sel.Ig(ii,:))); 0082 lower = upper + 1; 0083 upper = lower + sumIg - 1; 0084 DeltaIg(Sel.Ig(ii,:) == 1) = DeltaParam(lower:upper).'; 0085 Theta.Ig(ii,:) = OldTheta.Ig(ii,:) + DeltaIg; 0086 end % ii