(To be removed) Estimate recursively parameters of BoxJenkins models
Note:

thm = rbj(z,nn,adm,adg) [thm,yhat,P,phi,psi] = rbj(z,nn,adm,adg,th0,P0,phi0,psi0)
The parameters of the BoxJenkins model structure
$$y(t)=\frac{B(q)}{F(q)}u(tnk)+\frac{C(q)}{D(q)}e(t)$$
are estimated using a recursive prediction error method.
The inputoutput data is contained in z
,
which is either an iddata
object or a matrix z
= [y u]
where y
and u
are
column vectors. nn
is given as
nn = [nb nc nd nf nk]
where nb
, nc
, nd
,
and nf
are the orders of the BoxJenkins model,
and nk
is the delay. Specifically,
$$\begin{array}{c}nb\text{:}B(q)={b}_{1}+{b}_{2}{q}^{1}+\mathrm{...}+{b}_{nb}{q}^{nb+1}\\ nc\text{:}C(q)=1+{c}_{1}{q}^{1}+\mathrm{...}+{c}_{nc}{q}^{nc}\\ nd\text{:}D(q)=1+{d}_{1}{q}^{1}+\mathrm{...}+{d}_{nd}{q}^{nd}\\ nf\text{:}F(q)=1+{f}_{1}{q}^{1}+\mathrm{...}+{f}_{nf}{q}^{nf}\end{array}$$
See What Are Polynomial Models? for more information.
Only singleinput, singleoutput models are handled by rbj
.
Use rpem
for the multipleinput case.
The estimated parameters are returned in the matrix thm
.
The k
th row of thm
contains
the parameters associated with time k
; that is,
they are based on the data in the rows up to and including row k
in z
.
Each row of thm
contains the estimated parameters
in the following order.
thm(k,:) = [b1,...,bnb,c1,...,cnc,d1,...,dnd,f1,...,fnf]
yhat
is the predicted value of the output,
according to the current model; that is, row k
of yhat
contains
the predicted value of y(k)
based on all past data.
The actual algorithm is selected with the two arguments adm
and adg
.
These are described under rarx
.
The input argument th0
contains the initial
value of the parameters, a row vector consistent with the rows of thm
.
The default value of th0
is all zeros.
The arguments P0
and P
are
the initial and final values, respectively, of the scaled covariance
matrix of the parameters. See rarx
.
The default value of P0
is 10^{4} times
the unit matrix. The arguments phi0
, psi0
, phi
,
and psi
contain initial and final values of the
data vector and the gradient vector, respectively. The sizes of these
depend on the chosen model orders. The normal choice of phi0
and psi0
is
to use the outputs from a previous call to rbj
with
the same model orders. (This call could be a dummy call with default
input arguments.) The default values of phi0
and psi0
are
all zeros.
Note that the function requires that the delay nk
be
larger than 0
. If you want nk = 0
,
shift the input sequence appropriately and use nk = 1
.
nkshift
 recursiveBJ
 rpem
 rplr