I have a question about how EViews handles a stochastic model solution for a model in loglog form. For instance, I have a supply and demand model that looks something like this:
log(Y1) = B1*log(X1) + B2*log(X2) + B3*log(X2(t1)) + B4*log(Y1(t1)) + u
log(Y2) = A1*log(X1) + B2*log(W2) + B3*log(W2(t1)) + B4*log(Y2(t1))+ v
Y1 = Y2
Where Y1 and Y2 would be supply and demand, and X1 would be the price that links the equations.
I can solve the model using the stochastic command with the (c=t) option (equivalent to checking the box for "include coefficient uncertainty"). However, from the EViews 7 user manual, "coefficient uncertainty is ignored in nonlinear equations and in linear equations estimated with PDL terms."
Does that apply in this case since the model is in loglog form? (It technically is nonlinear since the supply and demand equations are in logs and the identity is in levels). If so, what is the stochastic error it is usingI still achieve uncertainty bounds, and if it were only equation estimation uncertainty (u and v, above), I wouldn't expect to see any significant variation of the uncertainty bounds from the point estimate.
It seems to me that EViews is using the uncertainty from the coefficient estimates (which is what I want it to do), but I want to make sure, given the warning in the manual. Maybe EViews is tranforming the model before it performs the monte carlo?
Thanks
Coefficient uncertainty in stochastic model solve  loglog
Moderators: EViews Gareth, EViews Moderator

 EViews Developer
 Posts: 161
 Joined: Wed Sep 17, 2008 10:39 am
Re: Coefficient uncertainty in stochastic model solve  log
I'm actually not sure what the documentation has in mind when it warns you about "nonlinear equations".
I stepped through the code and I can't see any difference in behaviour whether the estimated equation has a linear or nonlinear specification. Either way, we pull new values of the coefficients at each stochastic repetition based on the covariance matrix of the estimated coefficients.Your loglog equations are actually linear in coefficients anyway, so they certainly shouldn't cause problems.
Coefficient uncertainty does require that you are using linked equation objects to specify the equations since that is where we get the coefficient covariance matrix from.
I stepped through the code and I can't see any difference in behaviour whether the estimated equation has a linear or nonlinear specification. Either way, we pull new values of the coefficients at each stochastic repetition based on the covariance matrix of the estimated coefficients.Your loglog equations are actually linear in coefficients anyway, so they certainly shouldn't cause problems.
Coefficient uncertainty does require that you are using linked equation objects to specify the equations since that is where we get the coefficient covariance matrix from.
Re: Coefficient uncertainty in stochastic model solve  log
Got it. Thanks for the quick reply.
I suspected that the documentation might be in error given that the command was giving me what seemed to be random draws from the coefficients.
I suspected that the documentation might be in error given that the command was giving me what seemed to be random draws from the coefficients.
Re: Coefficient uncertainty in stochastic model solve  log
Well, it seems that it's not quite so simple. I went back to the model and ran a stochastic solution with coefficient uncertainty turned on and turned off, and the results are nearly identical (some difference between them, of course, but very similar). This suggests that the coefficient uncertainty setting is actually being turned off.
Again, while my equations are linear in the coefficients, the model itself is nonlinear because the identities are in levels, not logs.
I'm very interested to know what exactly EViews is doing here... where is it drawing values from for each iteration of the monte carlo?
Again, while my equations are linear in the coefficients, the model itself is nonlinear because the identities are in levels, not logs.
I'm very interested to know what exactly EViews is doing here... where is it drawing values from for each iteration of the monte carlo?

 EViews Developer
 Posts: 161
 Joined: Wed Sep 17, 2008 10:39 am
Re: Coefficient uncertainty in stochastic model solve  log
Could you be a bit more specific about exactly how you have things set up inside EViews?
When coefficient uncertainty is included in a simulation we generate a random draw for the coefficients at the beginning of each iteration. The draw follows a normal distribution using a mean and variance that match the point estimates and covariance estimates of the coefficients from the EViews estimation object that has been linked into the model (typically an equation object).
We assume there is no covariance between coefficients from separately estimated equations.
If your equation is specified 'in line' in the model (as a simple text specification) we can't generate coefficient uncertainty because we have no idea how uncertain the coefficients are.
Does that help?
When coefficient uncertainty is included in a simulation we generate a random draw for the coefficients at the beginning of each iteration. The draw follows a normal distribution using a mean and variance that match the point estimates and covariance estimates of the coefficients from the EViews estimation object that has been linked into the model (typically an equation object).
We assume there is no covariance between coefficients from separately estimated equations.
If your equation is specified 'in line' in the model (as a simple text specification) we can't generate coefficient uncertainty because we have no idea how uncertain the coefficients are.
Does that help?
Re: Coefficient uncertainty in stochastic model solve  log
Thanks, Chris.
My model is created by first creating equation estimation objects that are then appended to a model object. Here's a code snippet (never mind the specific variable names, of course):
My model is created by first creating equation estimation objects that are then appended to a model object. Here's a code snippet (never mind the specific variable names, of course):
Code: Select all
EQUATION _PS.tsls log(QSprim) c log(Pprim) log(Pwages) log(Penergy) log(CAP) log(QSprim(1)) @ log(Pwages) log(Penergy) log(CAP) log(QSprim(1)) log(Aindmfg) log(Pcu)
EQUATION _PD.tsls log(QDprim) c log(Pprim) log(Aindmfg) (log(Pcu)log(Pprim)) (log(Psec)log(Pprim)) log(QDprim(1)) @ log(Aindmfg) log(QDprim(1)) log(CAP) log(Penergy) log(Pwages) log(Pcapital) log(Pbaux)
EQUATION _SS.tsls log(QSsec) a0 log(Psec) log(Pscrap) log(Psilicon) log(pwages) log(pcapital) log(QSsec(1)) @ log(Pscrap) log(Psilicon) log(QSsec(1)) log(Acasting) log(Pcu) log(pwages) log(pcapital) a0
EQUATION _SD.tsls log(QDsec) c log(Psec) log(Acasting) (log(Pcu)log(Psec)) (log(Pprim)log(Psec)) log(QDsec(1)) @ log(Acasting) log(QDsec(1)) log(Pscrap) log(Psilicon) log(Pwages) log(Pcapital)
MODEL _al_1
_al_1.scenario(d) "Scenario 1"
%PS = _ps.@subst
_al_1.append %PS
%PD = _pd.@subst
_al_1.append %PD
%SS = _ss.@subst
_al_1.append %SS
%SD = _sd.@subst
_al_1.append %SD
_al_1.append Pprim*0 + StockPrim = StockPrim(1) + QSprim  QDprim + IMprim  EXprim
_al_1.append Psec*0 + StockSec = StockSec(1) + QSsec  QDsec + IMsec  EXsec
_al_1.stochastic(c=t, r=20000)
_al_1.solve(s=b, d=d, a=t, f=t)

 EViews Developer
 Posts: 161
 Joined: Wed Sep 17, 2008 10:39 am
Re: Coefficient uncertainty in stochastic model solve  log
You'll have to include the equations as links in the model instead of appending their text specification.
The text form for this is a colon followed by the equation obejct name,
Interactively, you can drag and drop the equation into the model. In a program, use the model.merge command.
In your case it would look something like this:
The text form for this is a colon followed by the equation obejct name,
Interactively, you can drag and drop the equation into the model. In a program, use the model.merge command.
In your case it would look something like this:
Code: Select all
MODEL _al_1
_al_1.scenario(d) "Scenario 1"
_al_1.merge _ps
Re: Coefficient uncertainty in stochastic model solve  log
I see. I am now trying to solve the model in the new way and running into errors of the kind
"Calculating Innovation Covariance Matrix
Sample: 1900 1979
Insufficient PPRIM innovations  Equation treated as nonstochastic
Insufficient PSEC innovations  Equation treated as nonstochastic
Matrix scaled to equation specified variances"
And multiple stalled solver iterations.
Nevertheless, it seems that my earlier method was only inputting the text representations of the equations and not the objects themselves. This makes it even more murky where, exactly EViews was looking to get the variance in the monte carlo to compute the confidence intervals... What was the source of this variance?
"Calculating Innovation Covariance Matrix
Sample: 1900 1979
Insufficient PPRIM innovations  Equation treated as nonstochastic
Insufficient PSEC innovations  Equation treated as nonstochastic
Matrix scaled to equation specified variances"
And multiple stalled solver iterations.
Nevertheless, it seems that my earlier method was only inputting the text representations of the equations and not the objects themselves. This makes it even more murky where, exactly EViews was looking to get the variance in the monte carlo to compute the confidence intervals... What was the source of this variance?
Who is online
Users browsing this forum: No registered users and 1 guest