[From Bill Powers (2002.11.11.1151 mst);
Rick M. and Bill W. (2002.11.10);
Attached is a block diagram (jpeg), turbo pascal 7.0 source code, and
executable code for "Giffen2", a 2-variable Giffen-effect program. This one
should be a lot more understandable than the other.
There are two control systems, one controlling calories and the other
controlling savings (my version of the "budget" control loop). The calorie
control system controls the number of calories received per day, so it
controls a rate variable. The Savings control system controls for a
specific level of savings, which is increased by the income per day and
decreased by the costs of buying bread and meat; savings is the integral of
the net of income and expenditures.
The rates of buying meat and bread are increased in equal amounts by a
calorie shortfall. A shortfall in savings increases the rate of bread
purchases and decreases the rate of meat purchases; these changes are
additive with the effects of the calorie error. There is a savings error
only when savings fall below the savings reference level; savings above
that level produce zero error. This means that for savings in excess of the
reference level, there is no preference for bread or meat.
I've used Bill Williams' way of adjusting parameters while the program
runs. the instructions are on the screen. A lower-case b reduces the price
of bread by 10%; an upper-case B increases it by 10%. M and m do the same
for the price of meat, and I and i adjust the income per day. The changes
go into effect immediately after each keystroke.
The other parameters in the program are constants.
The Giffen effect shows very nicely; also, if the price of meat is varied,
the "normal" demand relationship is seen -- that is, an increase in the
price of meat lowers the amount of meat purchased, even while an increase
in the price of bread _increases_ the amount of bread purchased.
This program does not include any bias in favor of meat, so when the income
is high enough, meat and bread are purchased in equal amounts rather than
all the calories being obtained from meat. This could be changed by putting
in some weights, but it would be better to show a third explicit control
Another version of this program would be interesting. Instead of the
savings control output simply adding to or subtracting from the rate of
daily bread and meat puchases, the savings control system could adjust a
weighting factor in each of the output lines of the calorie control system.
For zero savings error the bread weight would be 0 and the meat weight
would be 1; for savings errors above some limit, the bread weight would be
1 and the meat weight zero, of course with a smooth transition between the
limits. This is just a simple translation of the rule, "When short of
money, buy less meat and more bread", which is the same as what the present
model does, but using parameter adjustments rather than additive effects.
I don't think that the program works quite right outside the range of
parameters that shows the Giffen effect. Maybe you two can fix that.
(Attachment giffen2.jpg is missing)
Giffen2.pas (2.25 KB)
Giffen21.exe (12.2 KB)