How to build a single input multiple output ARX or ARMAX model with MATLAB
조회 수: 17 (최근 30일)
이전 댓글 표시
I want to build a single input multiple output ARMAX model,then the AR coefficient is extracted.
for example
y is an array of 6 rows and 8192 columns,I'll take the first line as input and the last five as output。
The AR coefficient is 2 and the Ma coefficient is 3
This is my code:
sr=y(1,:)'; %input
sc=y(2:6,:); %output
u1 = iddata([], sr);
sc=sc';
yy = iddata(sc);
na=[2 2 2 2 2];
nb=[3];
nk=[0];
nc=[0];
sys = armax([yy u1],[na nb nk nc]);
xishu=sys.A;
But matlab prompts:
In the "armax" command, the number of rows in the orders matrix must be equal to the number of model outputs.
I don't know where I was wrong
댓글 수: 0
채택된 답변
Rajiv Singh
2020년 8월 25일
Identification routines want variables to be arranged along the columns, time along rows. Your data "y" is transposed. Also, the order matrix dimensions are wrong (see documentation for the required sizes of orders). I would do something like this:
y = y';
ny = 5; % number of outputs
nu = 1; % number of inputs
data = iddata(y(:,2:6),y(:,1),1);
na = 2*eye(5); % note: na must be ny-by-ny!
nb = 3*ones(5,1); % nb must be ny-by-nu
nc = 0*ones(5,1); % nc must be ny-by-1
nk = zeros(5,1); % nk must be ny-by-nu
model = armax(data,[na nb nc nk])
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Correlation Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!