I want to estimate a Linear Expenditure System based on the Stone-Geary utility function:

where:
demand for commodity i;
marginal expenditure share with
; and
minimum quantity demanded from commodity i.Maximizing this function subject to the expenditure restriction
where
is price of commodity i and m is total expenditure, leads to the linear expenditure system:
.Time series form of the above equation is:
.At first, I estimate
by using the Engel function as:
.And after estimation of
, I plug it into the above equation and finally I estimate the above equation by SUR.But I don’t know how to estimate it in RATS by SUR. I don't know how to write a program for it in RATS.
I would be grateful if you could possibly guide me through it.

and
. In the first step, I use an Engel function (a panel model) for estimating
.