FLIPTYPE

For technical support, tips and tricks, suggestions, or any other information regarding the EViews model object.

Moderators: EViews Gareth, EViews Moderator

tvonbrasch
Posts: 540
Joined: Fri Apr 15, 2011 5:35 am

FLIPTYPE

Postby tvonbrasch » Fri Feb 23, 2024 2:28 am

Hi,

For a given data set, how can one ensure that FLIPTYPE rewrites the model in a meaningful way?

Example, consider the equation z+x*h=5*h, where x=0 in the data for one or more time periods. If we want to flip this equation and make h the endogenous variable, it may be rewritten as:

h=(z+x*h)/5

or

h = (5*h - z)/x

The FLIPTYPE command uses the latter specification, which results in a model that will not solve if x=0, see example below.

Is there a clever way to use FLIPTYPE in such a way that it will rewrite the model in an appropriate manner, given the underlying data?


Example:

Code: Select all

'read_model_example_fliptype
close @all
wfcreate u 1 100

'data
genr x=0
genr h=1
genr z=5*h-x*h

'model solves
model n
n.append h=(z+x*h)/5
n.msg
show n
n.solve

'model will not solve
model m
m.append z+x*h=5*h
m.fliptype z h
m.msg
show m
m.solve

EViews Matt
EViews Developer
Posts: 564
Joined: Thu Apr 25, 2013 7:48 pm

Re: FLIPTYPE

Postby EViews Matt » Wed Mar 27, 2024 2:30 pm

Hello,

The algebra performed by the fliptype procedure doesn't consider special cases when inverting functions, e.g., introducing a potential for division by zero where none existing previously. In general, the procedure will just attempt to "solve for" the leftmost instance of the new endogenous variable. The original form of the equation will therefore influence how the equation is rewritten, e.g., originally specifying Z as "Z-5*H+X*H=0" would cause fliptype to produce the specification for H you desire, but it's still a matter of manually examining and tweaking the model rather than something fully automatic.


Return to “Models”

Who is online

Users browsing this forum: No registered users and 13 guests