Announcement

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

  • Confusion between out of sample predict and forecast

    I have read the forecast manual, but I can't understand why using forecast produces different results than just predicting on the year variable on in-sample observations. Forecasting "now-casts" using actual values even if I don't check that box, while predict using in-sample observations would plug in the predictor values and output prediction using the estimated equation.

    In other words, when we use forecast, in which way is the model used on past observations? it looks as if it doesn't. it "predicts" the actual value whether or not that option is checked. Since I wish to see if my model predicts the "past" somewhat reasonably, this is of no use for me.

    A simple example to replicate:
    Code:
    clear all
    webuse sunspot
    tsappend, add(20)
    
    * Predict with regular linear model
    reg spot time
    estimate store lin
    predict spot_hat1
    
    tsline spot spot_hat1, name(predict)
    
    * Using stata's forecast
    forecast create forecast1
    forecast estimates lin
    forecast solve, suffix(_hat2) periods(20) static
    
    tsline spot spot_hat2, name(forecast)
    
    graph combine predict forecast
    Note that the "prediction" in forecast is just the actual values and it completely overlays the actual values.
Working...
X