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