Documentation 
Estimate polynomial model using time or frequencydomain data
sys = polyest(data,[na nb nc nd nf nk])
sys = polyest(data,[na nb nc nd nf nk],Name,Value)
sys = polyest(data,init_sys)
sys = polyest(___, opt)
sys = polyest(data,[na nb nc nd nf nk]) estimates a polynomial model, sys, using the time or frequencydomain data, data.
sys is of the form
$$A(q)y(t)=\frac{B(q)}{F(q)}u(tnk)+\frac{C(q)}{D(q)}e(t)$$
A(q), B(q), F(q), C(q) and D(q) are polynomial matrices. u(t) is the input, and nk is the input delay. y(t) is the output and e(t) is the disturbance signal. na ,nb, nc, nd and nf are the orders of the A(q), B(q), C(q), D(q) and F(q) polynomials, respectively.
sys = polyest(data,[na nb nc nd nf nk],Name,Value) estimates a polynomial model with additional attributes of the estimated model structure specified by one or more Name,Value pair arguments.
sys = polyest(data,init_sys) estimates a polynomial model using the dynamic system init_sys to configure the initial parameterization.
sys = polyest(___, opt) estimates a polynomial model using the option set, opt, to specify estimation behavior.
data 
Estimation data. For timedomain estimation, data is an iddata object containing the input and output signal values. You can estimate only discretetime models using timedomain data. For estimating continuoustime models using timedomain data, see tfest. For frequencydomain estimation, data can be one of the following:

na 
Order of the polynomial A(q). na is an NybyNy matrix of nonnegative integers. Ny is the number of outputs, and Nu is the number of inputs. na must be zero if you are estimating a model using frequencydomain data. 
nb 
Order of the polynomial B(q) + 1. nb is an NybyNu matrix of nonnegative integers. Ny is the number of outputs, and Nu is the number of inputs. 
nc 
Order of the polynomial C(q). nc is a column vector of nonnegative integers of length Ny. Ny is the number of outputs. nc must be zero if you are estimating a model using frequencydomain data. 
nd 
Order of the polynomial D(q). nd is a column vector of nonnegative integers of length Ny. Ny is the number of outputs. nd must be zero if you are estimating a model using frequencydomain data. 
nf 
Order of the polynomial F(q). nf is an NybyNu matrix of nonnegative integers. Ny is the number of outputs, and Nu is the number of inputs. 
nk 
Input delay in number of samples, expressed as fixed leading zeros of the B polynomial. nk is an NybyNu matrix of nonnegative integers. nk must be zero when estimating a continuoustime model. 
opt 
Estimation options. opt is an options set, created using polyestOptions, that specifies estimation options including:

init_sys 
Dynamic system that configures the initial parameterization of sys. If init_sys is an idpoly model, polyest uses the parameters and constraints defined in init_sys as the initial guess for estimating sys. If init_sys is not an idpoly model, the software first converts init_sys to an identified polynomial. polyest uses the parameters of the resulting model as the initial guess for estimation. Use the Structure property of init_sys to configure initial guesses and constraints for A(q), B(q), F(q), C(q), and D(q). To specify an initial guess for, say, the A(q) term of init_sys, set init_sys.Structure.a.Value as the initial guess. To specify constraints for, say, the B(q) term of init_sys:
You can similarly specify the initial guess and constraints for the other polynomials. If opt is not specified, and init_sys was created by estimation, then the estimation options from init_sys.Report.OptionsUsed are used. 
Specify optional commaseparated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
sys 
Estimated polynomial model. sys is an idpoly model. If data.Ts is zero, sys is a continuoustime model representing: $$Y(s)=\frac{B(s)}{F(s)}U(s)+E(s)$$ Y(s), U(s) and E(s) are the Laplace transforms of the timedomain signals y(t), u(t) and e(t), respectively. 
To estimate a polynomial model using timeseries data, use ar.
Use polyest to estimate a polynomial of arbitrary structure. If the structure of the estimated polynomial model is known, that is, you know which polynomials will be active, then use the appropriate dedicated estimating function. For examples, for an ARX model, use arx. Other polynomial model estimating functions include, oe, armax, and bj.
To estimate a continuoustime transfer function, use tfest. You can also use oe, but only with continuoustime frequencydomain data.