Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems specifying equations using -forecast- to solve simple supply and demand models

    I posted this question a couple years ago for version 13 (https://www.statalist.org/forums/for...-demand-models). I never got a helpful response, so I'm trying again now that we're two versions later. I'll see if I can simplify it a bit, as well. I understand not many people on here use -forecast-, but I'm really hoping someone from Statacorp will chime in with their intended use for this sort of thing.

    The -forecast- tool allows you to build a system of equations, solve it, and use it to produce dynamic forecasts, assess in the impact of adding a shock to a variable, etc. Quite useful in econometrics, and would be extremely useful in supply and demand models except for two (seemingly) crippling deficiencies.

    The way one builds a model in -forecast- is specifying equations that (as is standard in STATA) start with an endogenous variable and follow with explanatory variables.

    For instance, suppose you had a dataset with supply of some commodity X (sX) and demand of commodity X (dX). You know supply is affected by the price of X (pX) and another variable A. You know demand is also affected by pX and another variable B. You also assume market equilibrium so sX=dX.

    In other words, your simple system of equations looks like this:
    sX = a1 * pX + a2 * A
    dX = b1 * pX + b2 * B
    sX = dX
    where a1, a2, b1, and b2 are the price responses to be estimated.

    You've previously estimated equations for supply and demand using -ivregress- and stored the results in 'SUP' and 'DEM', respectively. To build this model, you'd write:

    Code:
    . forecast create supdem
    Forecast model supdem started.
    . forecast estimates SUP
    Added estimation results from ivregress.
    Forecast model supdem now contains 1 endogenous variable.
    . forecast estimates DEM
    Added estimation results from ivregress.
    Forecast model supdem now contains 2 endogenous variables.
    So far, so good. However, now you're faced with two problems unique to supply and demand models:
    1. You need to specify that supply and demand are equal (the market-clearing condition)
    2. You need to tell -forecast- that price is endogenous
    Unfortunately, -forecast- provides no options for doing either of these. In the case of the market-clearing identity, it offers the ability to create identities, but the identities also create endogenous variables in the model, and cannot begin with any endogenous variables that already exist in the model. For instance, if you type:

    Code:
    . forecast identity sX = dX
    you will get the error:
    Code:
    cannot add identity
        Endogenous variable sX has already been added to the model. You cannot
        add an endogenous variable to the model multiple times. Type forecast describe
        endogenous to see how the variable was added to the model.
    Additionally, there is no way to indicate to -forecast- that price (pX) should be treated as endogenous and solved for.

    This seems like such a basic use for -forecast-, and these seem like such basic problems that I'm sure the programmers thought of a way to make this work, but as far as I can tell this problem is unsolved from when I first posed it three years ago.

  • #2
    For those interested in this usage of -forecast-, here is what I was emailed from Stata tech support:

    "The developer evaluated the problem and determined that -forecast- does not
    currently provide a solution to the kind of models described in your Statalist
    post. This is going to be evaluated further, but whether this would be
    implemented and when this could be publicly available (in case it is
    implemented) is uncertain at this time."

    If this is something that interests you, I encourage you to let Statacorp know that they should add this (seemingly very simple) functionality in an update.

    Comment


    • #3
      Dear Trevor,
      I have the same problem,
      I have a macroeconomics model of equations in which I'm trying to forecast Real GDP growth and Real interest rate as final endogenous variables.

      it is obvious that this and some other variables play a dual role sometimes endogenous for one equation and exogenous for other equation

      I'm wondering that have received any up-to-date response from Stata? Or any other comment to help you introduce to software that it must calculate endogenously the P?

      have you succeed to solve your mentioned point five years ago?

      thank you very much

      Ardeshir

      Comment

      Working...
      X