Fits a set of structural nonlinear equations using Ordinary Least
Squares (OLS), Seemingly Unrelated Regression (SUR),
Two-Stage Least Squares (2SLS), Three-Stage Least Squares (3SLS).
the estimation method, one of "OLS", "SUR", "2SLS",
"3SLS".
eqns
a list of structural equations to be estimated.
startvals
a list of starting values for the coefficients.
eqnlabels
an optional list of character vectors of names
for the equation labels.
inst
one-sided model formula specifying instrumental variables
or a list of one-sided model formulas if different instruments should
be used for the different equations (only needed for 2SLS, 3SLS and
GMM estimations).
data
an optional data frame containing the variables in the model.
By default the variables are taken from the environment from which
nlsystemfit is called.
solvtol
tolerance for detecting linear dependencies in the columns
of X in the qr function calls.
maxiter
the maximum number of iterations for the nlm function.
...
arguments passed to nlm.
Details
The nlsystemfit function relies on nlm to perform the
minimization of the objective functions and the qr set
of functions.
A system of nonlinear equations can be written as:
ε_{t} = q( y_t, x_t, θ )
z_{t} = Z( x_t )
where ε_{t} are the residuals from the y observations and
the function evaluated at the coefficient estimates.
The objective functions for the methods are:
Method
Instruments
Objective Function
Covariance of
θ
OLS
no
r'r
(X(diag(S)^{-1}igotimes
I)X)^{-1}
SUR
no
r'(diag(S)_{OLS}^{-1}igotimes I)r
(X(S^{-1}igotimes I)X)^{-1}
2SLS
yes
r'(I igotimes W)r
(X(diag(S)^{-1}igotimes I)X)^{-1}
3SLS
yes
r'(S_{2SLS}^{-1} igotimes W)r
(X(diag(S)^{-1}igotimes W)X)^{-1}
where, r is a column vector for the residuals for each equation, S is
variance-covariance matrix between the equations
(hat{σ}_{ij} = (hat{e}_i' hat{e}_j) /
√{(T - k_i)*(T - k_j)}), X is matrix of the
partial derivates with respect to the coefficients, W is a matrix of the
instrument variables Z(Z'Z)^{-1}Z, Z is a matrix of the
instrument variables, and I is an nxn identity matrix.
The SUR and 3SLS methods requires two solutions. The first solution
for the SUR is an OLS solution to obtain the variance-covariance
matrix. The 3SLS uses the variance-covatiance from a 2SLS solution,
then fits all the equations simultaneously.
The user should be aware that the function is VERY sensative to
the starting values and the nlm function may not converge. The nlm
function will be called with the typsize argument set the
absolute values of the starting values for the OLS and 2SLS
methods. For the SUR and 3SLS methods, the typsize argument is
set to the absolute values of the resulting OLS and 2SLS coefficient
estimates from the nlm result structre. In addition, the starting
values for the SUR and 3SLS methods are obtained from the OLS and 2SLS
coefficient estimates to shorten the number of iterations. The number of
iterations reported in the summary are only those used in the last
call to nlm, thus the number of iterations in the OLS portion of the
SUR fit and the 2SLS portion of the 3SLS fit are not included.
Value
nlsystemfit returns a list of the class nlsystemfit.system and
contains all results that belong to the whole system.
This list contains one special object: "eq". It is a list and contains
one object for each estimated equation. These objects are of the class
nlsystemfit.equation and contain the results that belong only to the
regarding equation.
The objects of the class nlsystemfit.system and
nlsystemfit.equation have the following components (the elements of
the latter are marked with an asterisk (*)):
eq
a list object that contains a list object for each equation.
method
estimation method.
resids
an n \times g matrix of the residuals.
g
number of equations.
n
total number of observations.
k
total number of coefficients.
b
vector of all estimated coefficients.
se
estimated standard errors of b.
t
t values for b.
p
p values for b.
bcov
estimated covariance matrix of b.
rcov
estimated residual covariance matrix.
drcov
determinant of rcov.
rcovest
residual covariance matrix used for estimation (only SUR and 3SLS).
rcor
estimated residual correlation matrix.
nlmest
results from the nlm function call
solvetol
tolerance level when inverting a matrix or calculating a determinant.
## elements of the class nlsystemfit.eq
eq
a list that contains the results that belong to the individual equations.
eqnlabel*
the equation label of the ith equation (from the labels list).
formula*
model formula of the ith equation.
n*
number of observations of the ith equation.
k*
number of coefficients/regressors in the ith equation.
df*
degrees of freedom of the ith equation.
b*
estimated coefficients of the ith equation.
se*
estimated standard errors of b.
t*
t values for b.
p*
p values for b.
covb*
estimated covariance matrix of b.
predicted*
vector of predicted values of the ith equation.
residuals*
vector of residuals of the ith equation.
ssr*
sum of squared residuals of the ith equation.
mse*
estimated variance of the residuals (mean of squared errors) of the ith equation.
s2*
estimated variance of the residuals (hat{σ}^2) of the ith equation.
rmse*
estimated standard error of the residulas (square root of mse) of the ith equation.
s*
estimated standard error of the residuals (hat{σ}) of the ith equation.