# Help File for Generalized Flexible Least Squares (GFLS)

 Last Updated: 16 January 2023 Site Maintained By: Leigh Tesfatsion Research Professor & Professor Emerita of Economics Courtesy Research Professor of Electrical & Computer Engineering Heady Hall 260 Iowa State University Ames, Iowa 50011-1054 https://www2.econ.iastate.edu/tesfatsi/ tesfatsi AT iastate.edu GFLS Fortran Program Flexible Least Squares (FLS) Homepage

The Fortran program GFLS, developed by Robert E. Kalaba and Leigh Tesfatsion, implements a generalized flexible least squares (GFLS) method for the estimation of nonlinear systems described by approximately linear dynamic and measurement relations.

The basic GFLS objective is to determine the Cost-Efficient Frontier (CEF) for such systems in analogy to the determination of Pareto-efficient frontiers for multicriteria decision problems. The CEF is the collection of all state trajectory estimates that are efficient for the system at hand in the sense that they are minimally incompatible with the specified dynamic and measurement relations.

The GFLS method was proposed and developed in detail by Robert Kalaba and Leigh Tesfatsion in "Flexible Least Squares for Approximately Linear Systems" (pdf,1.2M), IEEE Transactions on Systems, Man, and Cybernetics, Vol. 20, No. 5 (1990), pp. 978-989. (The published article is available from IEEE Xplore.) This article constitutes the manual for the GFLS program.

The GFLS program has been incorporated into the statistical package GAUSS - TSM (Time Series Methods). See the FLS Homepage for additional information about the general FLS approach to model estimation.

### Outline of GFLS Program Logic:

Variables:

x_t  =  n x 1 column vector of state variables

y_t  =  m x 1 column vector of observations

Dynamic and Measurement Equation Matrices and Forcing Terms:

F(t) =  n x n dynamic equation matrix, t  =  1,...,T-1

a(t) =  n x 1 dynamic equation forcing term, t  =  1,...,T-1

H(t) =  m x n measurement equation matrix,  t  =  1,...,T

b(t) =  m x 1 measurement equation forcing term,  t  =  1,...,T

Prior Dynamic Specification (Approximately Linear Dynamics):

x_{t+1}   \approx=   F(t)x_t  +  a(t) ,     t = 1,...,T-1

Prior Measurement Specification (Approximately Linear Measurements):

y_t   \approx=   H(t)x_t  +  b(t) ,    t = 1,...,T

Penalty Weight Specifications for the Incompatibility Cost Function:

D(t) = symmetric positive definite nxn matrix, t = 1,...,T-1

M(t) = symmetric positive definite mxm matrix, t = 1,...,T

Q_0  = symmetric positive definite nxn matrix

p_0  = nx1 column vector

r_0  = scalar

INCOMPATIBILITY COST FUNCTION SPECIFICATIONS:

Let x* = (x*_1,...,x*_T) denote any possible choice for a sequence of
state vector estimates.

Dynamic Cost Associated with the Choice of x*:

T-1
C_D(x*;T)  =  SUM [x*_{t+1}- F(t)x*_t - a(t)]'D(t)[x*_{t+1}-F(t)x*_t - a(t)]
t=1

Measurement Cost Associated with the Choice of x*:

T
C_M(x*;T)  =  SUM [y_t - H(t)x*_t - b(t)]'M(t)[y_t - H(t)x*_t - b(t)]
t=1

Initialization Cost Associated with the Choice of x*_1:

C_I(x*,T)  =  [x*_1'Q_0x*_1] - [2x*_1'p_0]  +  r_0

Total Incompatibility Cost Associated with the Choice of x* for a Given

C(x*;\mu,T)  =   \mu[C_D(x*,T)] + C_M(x*,T) + C_I(x*,T)  .

GFLS PROBLEM FOR GIVEN \mu AND T:

Determine the trajectory x* which minimizes the total cost function
C(x*;\mu,T).  This trajectory is called the "general flexible least
squares (GFLS) solution conditional on \mu and T."

COMPUTER IMPLEMENTATION:

The Fortran program GFLS generates the general flexible least
squares solution in a sequential manner.  Comment statements are
interspersed throughout the program GFLS explaining the sequential
updating equations.  The order of derivation is as follows:

Time-T Updating Equations, T \geq 1:

In storage at time T \geq 1 are the exogenously given matrices
and vectors F(T), a(T), H(T), b(T), D(T), and M(T) and the
previously calculated (if T exceeds 1) or exogenously given (if T = 1)
matrix, vector, and scalar Q_{T-1}(\mu), p_{T-1}(\mu), and
r_{T-1}(\mu).  A new observation y_T is obtained.  Determine in
order:

U_T(\mu)  =  H(T)'M(T)H(T)  +  Q_{T-1}(\mu)

C(T)   =  F(T)'D(T)

W_T(\mu)  =  \mu [C(T)F(T)]  +  U_T(\mu)

V_T(\mu)  =  [W_T(\mu)]^{-1}

e_T     =  y_T - b(T)

z_T(\mu)  =  H(T)'M(T)e_T + p_{T-1}(\mu)

G_T(\mu)  =  \mu [V_T(\mu)C(T)]

Q_T(\mu)  =  \mu D(T)[I - F(T)G_T(\mu)]

p_T(\mu)  =  G_T(\mu)'z_T(\mu)  +  Q_T(\mu)'a(T)

s_T(\mu)  =  V_T(\mu)[z_T(\mu) - \mu C(T)a(T)]

r_T(\mu)  =  r_{T-1}(\mu) + e_T'M(T)e_T + \mu [a(T)'D(T)a(T)]
- s_T(\mu)'W_T(\mu)s_T(\mu)

GFLS Filtered State Estimate Obtained at time T:

x_T^{FLS}(\mu,T)  =  [U_T(\mu)]^{-1}z_T(\mu)

GFLS Smoothed State Estimates Obtained at time T:

x_t^{FLS}(\mu,T) = s_t(\mu) + G_t(\mu)x_{t+1}^{FLS}(\mu,T),

for 0 less than or equal to t, and for t less than T.