edit/override of identity

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

Posts: 27
Joined: Wed Aug 02, 2017 6:07 am

edit/override of identity

Postby BT454 » Wed Jan 09, 2019 8:46 am

I have a short program that compiles and solves a model for energy prices.
It forecasts a real price, and then inflates it using a GDP deflator to create a nominal price. I would like to make adjustments to the nominal price (identity) directly using the "edit/override" function. Is this possible? Currently, when I edit/override --> make changes --> reinclude --> resolve the nominal price series gets very wonky and goes negative.

here is the model code for reference:
wfcreate HHData m 2011 2050
%fstart = "2019m1"
pagerename untitled data
wfopen ngbdata
copy ngbdata::usdm\deflatoryrus HHData::data\df
wfclose ngbdata

'import data
import c:\warem32\HHModData.xlsx range="Independent" @freq m 2011
import c:\warem32\HHModData.xlsx range="HHPrice" @freq m 2011

'create model object
model HHPMod

smpl 2015 2050

equation HHPeq.ls(h) hhprice usdmnd usl48sd @expand(month, @drop(11), @drop(12)) ar(1) ar(3) ar(5) ar(8)

HHPMod.append @identity HHPN = HHPrice*DF

HHPmod.merge HHPeq

smpl %fstart 2050m12


solve HHPMOD

HHPMOD.scenario(n) "Adjust"
HHPMOD.scenario(a=_1) "Adjust"

smpl %fstart 2050M12
solve HHPMOD

'setting up for adjustments
%n = HHPMOD.@stochastic
HHPMOD.addassign(v) {%n}
HHPMOD.addinit(s=a,v=z) {%n}

%o =HHPMOD.@stochastic
%p = @wcross(%o,"_a")
%q = @wcross(%p,"_1")

for %j {%q}
!i = @isobject(%j)
if(!i = 1) then
delete {%j}

HHPMOD.override {%p}
HHPMOD.addinit(v=z,s=o) {%o}

'!...Run A "Regular Solve"

smpl %fstart 2050m12
solve HHPMOD

%n = HHPMOD.@stochastic
HHPMOD.exclude(r) {%n}
HHPMOD.addinit(s=a,v=a) {%n}
solve HHPMOD

HHPMOD.override(r) {%n}
solve HHPMOD

statusline Done With Model Creation/Setup

Posts: 1
Joined: Mon Mar 11, 2019 4:18 pm

Re: edit/override of identity

Postby eviews1234 » Thu Mar 14, 2019 6:14 am


Wondering if you got to bottom of this (if so, how so)?

Thank you.

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 3 guests