👨🎓个人主页:研学社的博客
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
动态系统故障诊断经常面临大量可能的故障。为了避免棘手的组合问题,稀疏估计技术似乎是隔离故障的有力工具,假设只有少数可能的故障可以同时处于活动状态。然而,稀疏估计通常在线性代数方程的框架内进行研究,而基于模型的故障诊断通常用于使用涉及内部状态的状态方程建模的动态系统。这些Matlab文件说明了如何通过高效可靠的算法在上述两种形式之间建立联系,主要基于卡尔曼和基塔尼迪斯滤波器生成的残差的高级分析。详细数学模型讲解见第四部分。
📚2 运行结果
2.2 卡尔曼滤波
2.2 塔尼迪斯滤波
部分代码:
%% Call lasso.m while deterimining the value of lambda
% It is possible to choose lambda by cross-validation.
% This code follows the approach presented in the IEEE-TSP paper.
[~,FitInfo]=lasso(CUpsilon,ytilde, 'NumLambda',2); % First call of lasso for the min and max values of lambda.
Lambda_linspaced = linspace(FitInfo.Lambda(1),FitInfo.Lambda(end),100); % 100 equally (linearly) spaced lambda values.
[thetaLasso,FitInfo]=lasso(CUpsilon,ytilde,'Lambda', Lambda_linspaced); % Call lasso with 100 lambda values.
%thetaLasso contains 100 columns, each corresponding to a value of lambda in Lambda_linspaced.
% Note: lasso.m adds an "Intercept" term, centers CUpsilon and ytilde, and normalizes the columns of CUpsilon.
numnz = sum(thetaLasso~=0,1); % number of non zero values in each column of thetaLasso
nlam = length(numnz); % number of Lambda values
localct = zeros(1,nlam);
for k=2:nlam % Increase localct by 1 at each k if numnz does not change
if numnz(k)==numnz(k-1)
localct(k) = localct(k-1)+1;
else
localct(k) = 0; % Reset localct to zero if numnz changes
end
end
% Eliminate non sparse solutions (too large values in numnz)
localct(numnz>p/2) = 0;
% Find largest localct section
[~,endind] = max(localct);
begind = find(localct(1:endind)==0,1,'last');
midind = round((begind+endind)/2); % The column thetaLasso(:,midind) will be retained.
% Replace 0 with NaN for plotting the results
thetaLassoNaN = thetaLasso;
thetaLassoNaN(thetaLassoNaN==0) = nan;
%% Least squares refinement
nzind = find(thetaLasso(:,midind)~=0); % The indexes of non-zero theta components determined by Lasso
thetaLS = CUpsilon(:,nzind)\ytilde; % Least squares estimates of non-zero theta components
thetaLSfull = nan(p,1);
thetaLSfull(nzind) = thetaLS; % thetaLSfull contains thetaLS completed with NaNs.
thetaTrueNaN = thetaTrue;
thetaTrueNaN(thetaTrueNaN==0) = nan; % Replace 0 with NaN for plotting results
%% Plotting results
if ~ishandle(1)&&~ishandle(2)
figure(1)
figure(2)
pos1=get(1,'pos');
pos2=get(2,'pos');
pos2(2)=pos1(2)-pos1(4)*1.2;
set(2, 'pos', pos2)
end
figure(1)
clf
plot(FitInfo.Lambda,numnz,'-d', FitInfo.Lambda(begind:endind),numnz(begind:endind),'-dr');
xlabel('$\lambda$', 'interpreter','latex', 'FontSize',12)
text(FitInfo.Lambda(4),mean(numnz(1:2)), 'Number of non-zero \theta components found by Lasso per \lambda', 'FontSize',12)
xlim([0 FitInfo.Lambda(end)])
shg
🎉3 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1] Qinghua Zhang, Dynamic System Fault Diagnosis under Sparseness Assumption. IEEE Transactions