[From Bill Powers (971205.1900 MST)]
Bruce Abbott (971205.2005 EST)--
The demonstration that I posted a few day ago on the Behavioral Illusion
seems to have falled into a black hole. Has anyone beside Rick had a look
at it?
I received and ran it the day it was posted; it's quite impressive. I don't
think the source code was distributed though, and have been meaning to ask a
question: why is there hysteresis in the disturbance graph-line which is
produced when you move the mouse back and forth?
I did attach the source code as well as the excutable program, but it may
have come through as part of the message -- let me look... Yes, I have
checked the box that says "Put text attachments in body of message." So
look farther down in the message -- no, don't bother, I'll just append it
to this message in the text.
The hysterisis is caused by the fact that the environmental feedback
function is a cubic curve with a reversal of slope near the origin. As the
output rises from zero, the effect on the controlled variable first goes
negative, then turns around and goes positive. Near zero output there is
positive feedback. The opposite relationships occur for negative-going
outputs.
The result is that the control system, when it reaches a positive-feedback
point, starts producing a very large rate of change of output until it
reaches the next value where there is negative feedback again. You see this
on the plot as a sudden jump of output (the slower you change the
disturbance, the more abrupt the jump is). There is a brief peak of error
during this positive-feedback transition, as you can see from the red plot,
but everywhere else the error remains close to zero. Without the control,
by the way, the error would be the same size as the disturbance (the
horizontal and vertical scales are the same). This means that the
perceptual signal was maintained quite close to the (zero) reference signal
at all times, except for the instants of transition.
The control system itself in all cases is simply
p := v;
e := r - p;
o := o + 0.3*e
where v is the controlled variable plotted vertically on the screen.
The five environmental feedback functions were given in the original post.
I'm sure it would be possible to get even more dramatic effects given a
little time to think up nefarious functions -- these were the first five
off the top of my head.
The point of the exercise, as you know, is to show that when the
disturbance is considered the IV and the output the DV, the measured
dependence of the DV on the IV has a form that reflects the inverse of the
environmental feedback function, and does not represent the actual
input-output function of the organism. In order to see this effect, one
must know what the controlled variable is, and how it is affected both by
the disturbance and by the output of the system. In normal studies where
the underlying paridigm is lineal cause and effect, the controlled variable
would not be picked up (it wouldn't be looked for, and anyway it doesn't
vary much). So there would be no way to discover that the apparent
relationship of IV to DV is illusory.
Incidentally, if you use the cubic environmental feedback function in a
real experiment, you will see human controllers behaving just as the system
in this demo does. In fact I think all five EFFs would give the same
results with a human being or the computer program.
Source code below.
Best,
Bill P.
program illusion;
uses dos,crt,graph, grutils,mouse;
var d,v,p,e,r,o: real;
fb: char;
first: boolean;
procedure controlsys;
begin
p := v;
e := r - p;
o := o + 0.3*e;
case fb of
'1': v := d + o;
'2': if o > 0 then v := d + 0.3*o else v := d + 3*o;
'3': v := d + 1e-4*o*o*o - 0.0001* o;
'4': v := d + 5e-5*o*o*o - o;
'5': v := d + 40.0*sin(o/20.0) + 1.0*o;
end;
end;
procedure axes;
begin
line(0,240,639,240);
line(320,0,320,479);
end;
procedure legends;
begin
setcolor(white);
outtextxy(0,0,'FEEDBACK FUNCTION ' + fb);
setcolor(lightred);
outtextxy(300,0,'ERROR');
setcolor(lightgreen);
outtextxy(300,15,'OUTPUT');
setcolor(white);
outtextxy(0,220,'DISTURBANCE <--->');
outtextxy(0,420,'MOVE MOUSE SIDEWAYS TO ADJUST DISTURBANCE');
outtextxy(0,435,'TYPE 1 TO 5 TO SELECT FEEDBACK FUNCTION');
outtextxy(0,450,'TYPE "q" to quit');
end;
procedure showline;
const oldd: integer = 0;
begin
line(320 + oldd,220,320+oldd,235);
oldd := round(d);
end;
begin
initgraphics;
clearviewport;
setwritemode(XORPut);
fb := '1';
legends;
axes;
d := 0.0;
first := true;
repeat
readmouse;
d := d + 0.03*(mousex div 3 - d);
if keypressed then
begin
fb := readkey;
clearviewport;
axes;
legends;
showline;
d := 0.1; {to avoid stray lines}
end;
if first then first := false
else showline;
controlsys;
putpixel(320 + round(d), 240 - round(o),lightgreen);
putpixel(320 + round(d), 240 - round(e),lightred);
showline;
delay(1);
until fb = 'q';
end.