Recursive Prediction-Error Minimization estimation
[w1,[v]]=rpem(w0,u0,y0,[lambda,[k,[c]]])
list(theta,p,l,phi,psi)
where:
[a,b,c] is a real vector of order 3*n
a=[a(1),...,a(n)], b=[b(1),...,b(n)], c=[c(1),...,c(n)]
(3*n x 3*n) real matrix.
real vector of dimension 3*n
Applicable values for the first call:
real vector of inputs (arbitrary size). (u0($)
is not used by rpem)
vector of outputs (same dimension as u0
). (y0(1)
is not used by rpem).
If the time domain is (t0,t0+k-1)
the u0
vector contains the inputs
u(t0),u(t0+1),..,u(t0+k-1)
and y0
the outputs
y(t0),y(t0+1),..,y(t0+k-1)
optional argument (forgetting constant) chosen close to 1 as convergence occur:
lambda=[lambda0,alfa,beta]
evolves according to :
lambda(t)=alfa*lambda(t-1)+beta | ![]() | ![]() |
with lambda(0)=lambda0
contraction factor to be chosen close to 1 as convergence occurs.
k=[k0,mu,nu]
evolves according to:
with k(0)=k0
.
Large argument.(c=1000
is the default value).
Update for w0
.
sum of squared prediction errors on u0, y0
.(optional).
In particular w1(1)
is the new
estimate of theta
. If a new
sample u1, y1
is available the update is
obtained by:
[w2,[v]]=rpem(w1,u1,y1,[lambda,[k,[c]]])
. Arbitrary
large series can thus be treated.
Recursive estimation of arguments in an ARMAX model. Uses Ljung-Soderstrom recursive prediction error method. Model considered is the following:
The effect of this command is to update the estimation of
unknown argument theta=[a,b,c]
with
a=[a(1),...,a(n)], b=[b(1),...,b(n)], c=[c(1),...,c(n)]
.
nbPoints = 50; // Number of points computed // Real parameters a,b,c: here, y=u a=cat(2,1,zeros(1,nbPoints - 1)); b=cat(2,1,zeros(1,nbPoints - 1)); c=zeros(1,nbPoints); // Generate input signal t=linspace(0,50,600); w=%pi/3; u=cos(w*t); // Generate output signal Arma=armac(a,b,c,1,1,0); y=arsimul(Arma,u); f1=figure("figure_name","figure1","backgroundColor",[1 1 1]); subplot(3,1,1); plot(t, u, "b+"); xtitle("Input"); subplot(3,1,2); plot(t, y); // Arguments of rpem phi=zeros(1,nbPoints*3); psi=zeros(1,nbPoints*3); l=zeros(1,nbPoints*3); p=1*eye(nbPoints*3,nbPoints*3); theta=[0*a 0*b 0*c]; w0=list(theta,p,l,phi,psi); [w0, v]=rpem(w0,u,y); // Get estimated parameters: a_est=w0(1)(1); b_est=w0(1)(nbPoints + 1); c_est=w0(1)(2 * nbPoints + 1); for i=2:nbPoints a_est=cat(2,a_est,w0(1)(i)); b_est=cat(2,b_est,w0(1)(i+nbPoints)); c_est=cat(2,c_est,w0(1)(i+2*nbPoints)); end // Generate and plot output estimated Arma_est=armac(a_est,b_est,c_est,1,1,0); y_est=arsimul(Arma_est,u); plot(t, y_est,"color","red"); xtitle("Real output(blue), Estimated output (red)"); // Plot estimated parameters subplot(3,1,3); xtitle("a,b,c estimated"); plot(a_est(1,:),"color","red"); plot(b_est(1,:),"color","green"); plot(c_est(1,:),"color","blue"); | ![]() | ![]() |