Andrews plot function for multivariate control chart limits UCL and LCL

7 ビュー (過去 30 日間)
Nainsi Gupta
Nainsi Gupta 2023 年 7 月 1 日
コメント済み: Paul 2023 年 7 月 2 日
I am working on Andrews plot for quality control chart. So I need to define UCL and LCL for that. I have attached the images of the paper for the reference and better clarity.
Please tell me how can I develop a vector for A(theta) in the attached image. I also need to use this function for the monitoring the out-of-control points at the later stage.

採用された回答

Paul
Paul 2023 年 7 月 1 日
Brute force approach ...
Use symbolic for illustration
syms theta
p = 5;
A = reshape([sin((1:p)*theta) ; cos((1:p)*theta)],1,[])
A = 
A = [1/sqrt(sym(2)) A];
A = A(1:p)
A = 
Also, you may be interested in andrewsplot
  2 件のコメント
Nainsi Gupta
Nainsi Gupta 2023 年 7 月 2 日
Thank you for your answer Paul.
How can I define theta for a limit -pi to pi? And then how to plot it.
Paul
Paul 2023 年 7 月 2 日
x = 1:6; % an observation
% non-vectorized approach, but easy(?) to follow
syms theta
p = size(x,2);
A = reshape([sin((1:p)*theta) ; cos((1:p)*theta)],1,[]);
A = [1/sqrt(sym(2))+0*theta A];
A = A(1:p)
A = 
A = matlabFunction(A)
A = function_handle with value:
@(theta)[sqrt(2.0)./2.0,sin(theta),cos(theta),sin(theta.*2.0),cos(theta.*2.0),sin(theta.*3.0)]
theta = linspace(-pi,pi,100);
aplot1 = 0*theta;
for ii = 1:numel(aplot1)
aplot1(ii) = sum(x.*A(theta(ii)),2);
end
figure
plot(theta,aplot1)
% non-symbolic, vectorized approach
neven = ceil((p-1)/2);
nodd = floor((p-1)/2);
aplot2 = x(1)/sqrt(2) + sum(x(2:2:end).*sin(theta(:).*(1:neven)),2) + sum(x(3:2:end).*cos(theta(:).*(1:nodd)),2);
figure
plot(theta,aplot2)
norm(aplot1(:)-aplot2(:))
ans = 6.3429e-15

サインインしてコメントする。

その他の回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2023 年 7 月 1 日
syms theta
% P variate vector
%Cross check here, just random data, it can be variable
p=10;
data_sin=sin((1:round(p/2)+1)*theta);
data_cos=cos((1:round(p/2))*theta);
data(1:2:2*numel(data_sin))=data_sin;
data(2:2:end)=data_cos;
data=[1/sqrt(2),data]
data = 
  2 件のコメント
Nainsi Gupta
Nainsi Gupta 2023 年 7 月 1 日
How can I define a limit for theta (-pi<theta<pi)
Nainsi Gupta
Nainsi Gupta 2023 年 7 月 1 日
Also there is some issue with the code. if p=3, then data should contain 3 elements. similarly for other values of p

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by