MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Q: Solving econometric models

  • To: mathgroup at
  • Subject: [mg30941] Re: Q: Solving econometric models
  • From: Luci Ellis <elisha at>
  • Date: Thu, 27 Sep 2001 02:17:05 -0400 (EDT)
  • References: <9oc9bp$g90$>
  • Sender: owner-wri-mathgroup at

Dear Mark,

Yes, you can definitely do this without a loop, by using a NestList or
FoldList function.  For example (caveat lector - I haven't tested this):

With[{results = Regress[(* whatever *)]}, With{a=results[[1]], b =
results[[2]]... Etc},
FoldList[{ a + b #1[[1]] + c #2, d + e #1[[2]] + f #1[[1]]}, {y0, z0},
ListOfKnownFutureXs] ]]

The trick is to think of things in matrix form and preferably in state-space

You might find some of the notebooks on generating different time series at
my Mathematica and Economics web site useful inspiration:

Hope that helps,
Luci Ellis

in article 9oc9bp$g90$1 at, Mark S. Coleman at
mcoleman at wrote on 20/9/01 6:28 PM:

> Greetings:
> I apologize in advance for the rather vague nature of this question,
> but I am hoping that MathGroup members might be able to point me in
> the right direction.
> I am working with a number of small econometric models that I have
> estimated (using Regress) in Mathematica v4.0. The models support a number of
> out-of-sample economic forecasting applications. As part of the
> research I am conducting, I need to 'solve' these equations -- that
> is, generate projections of future economic activity. This type of
> functionality is generally a standard part of "conventional"
> statistical/econometric packages, and I am seeking to replicate this
> functionality in Mathematica.
> To illustrate the problem, consider the following very simple
> two-equation model (note that I am not using Mathematica notation here):
> y(t) = a + b*y(t-1) + c*x(t)
> z(t) = d + e*z(t-1) + f*y(t-1)
> where t denotes time, y,z, and x are variables, and {a...f} are=
> real 
> numbers (say estimated using Regress). Assume that
> t=1,...,n,n+1,n+2,...,T.
> Assume that the models were estimated using the sample of data from
> 1,...,n. The objective is to solve or forecast this model over the
> future periods n+1, n+2,...,T. Also assume that x(t) is known over
> the future periods.
> In my attempts to solve this problem in Mathematica, I've created a list of
> rules (taken from the BestFit option in Regress) and then 'looped'
> over the list of future periods, one period at a time, and used the
> ReplaceAll function.
> This raises a couple of questions. First, to use prior solved values,
> I've had to create a new equation to define each of the lagged
> values, y(t-1) and z(t-1). Is there a better way to handle this?
> Second, can the model be written in Mathematica notation to solve over the
> entire set of future time periods without the use of an explicit
> loop? 
> Any help would be greatly appreciated.
> -Mark

  • Prev by Date: Re: Export table problem
  • Next by Date: Re: Preserve natural number "e" using N or SetPrecision
  • Previous by thread: Re: Q: Solving econometric models
  • Next by thread: Problem with Interval Calculations?