[Martin Taylor 960930 16:10]

Bill Powers (960930.1330 MDT)

It isn't necessary that you understand my reluctance in order for it to

exist.

True, but if I understand what you are controlling for, it helps me to

find a disturbing influence that might help me to get my perceptions nearer

their reference values through your actions.

But perhaps if you just push harder, you can get me to relax my

resistance to doing the task you want to set for me.

Harder, or differently? Let's try differently.

I believe I sent you each of my series of analysis c-code, all of which

were based on your own code, with amendments suggested by both of us.

All the later codes (and perhaps all the earlier ones as well) produce

outputs for the mean square deviations between: human and target (ht), human

and model (hm), model and target (mt).

All I want you to do is to perform a tracking run (even one good run might

do, though two or three would be better) for each of the five tasks, and

then to do the analysis, getting out the correlation fit and the value:

xx = (4/3.14159)*atan2($12,$11);

where $12 and $11 are the twelfth and eleventh outputs of the newer

analysis programs--result.pe1 and result.te1 in all the programs, I think.

These are the RMS prediction error (which is minimized by the fitting

algorithm) and the RMS tracking error (the actual data).

The fitting part of the model I am using follows, in case you need

to identify which one corresponds to my data--though it would be interesting

indeed to try the same thing with the various models we have used.

I hope that this will suggest to you that only a small investment of

your time is required, and that the results might be useful--if only to

shut me up, but perhaps for PCT as well.

Martin

----------------C code follows, to help identify which analysis------------

---------------program I have been using in the reported results-----------

void fitparams()

{ double errsqud, errsquk, errsquz, errsqdd, errsqdk, errsqdz, lasterrsq;

double testupz, curincz, testupk, curinck, testupd, curincd;

double cincd, cinck, cincz;

double testdnd, testdnk, testdnz;

double ediffud, ediffuk, ediffuz, ediffdd, ediffdk, ediffdz, ediffsum;

double newd, newk, newz, newerrsq, minerrsq;

double mewd, mewk, mewz, mewerrsq;

double stepz, minstepz, stepk, minstepk, stepd, minstepd;

int i, j, jold, imax, imin;

short dbl, halve;

double emin, emax;

double pwrs;

/* initialize */

curincz = startincz;

curinck = startinck;

curincd = startincd;

curz = startz;

curk = startk;

curd = startd;

dbl = halve = FALSE;

stepd = startincd;

stepk = startinck;

stepz = startincz;

minstepd = 0.01;

minstepk = 0.01;

minstepz = startincz/8.0;

pwrs = runexpt ((float)curd, curk, curz);

while ((fabs(stepd)>=minstepd)||(fabs(stepk)>=minstepk)||(fabs(stepz)>=minstepz))

{

lasterrsq = runexpt ((float)curd, curk, curz);

testupz = curz + curincz;

testupk = curk * curinck;

testupd = curd * curincd;

minerrsq = lasterrsq; j = 0;

errsqud = runexpt(testupd, curk, curz);

errsquk = runexpt(curd, testupk, curz);

errsquz = runexpt(curd, curk, testupz);

ediffud = errsqud - lasterrsq;

if (ediffud < 0) {minerrsq = errsqud; j = 1;}

ediffuk = errsquk - lasterrsq;

if (errsquk < minerrsq) {minerrsq = errsquk; j = 2;}

ediffuz = errsquz - lasterrsq;

if (errsquz < minerrsq) {minerrsq = errsquz; j = 3;}

ediffsum = fabs(ediffud) + fabs(ediffuk) + fabs(ediffuz);

/* Test at a point suggested by the improvements or worsening along the

/* parameter axes.

*/

if (ediffud > 0) cincd = 1.0 - (curincd - 1.0)*ediffud/ediffsum;

else cincd = 1.0 + (curincd - 1.0)*ediffud/ediffsum;

if (ediffuk > 0) cinck = 1.0 - (curinck - 1.0)*ediffuk/ediffsum;

else cinck = 1.0 + (curinck - 1.0)*ediffuk/ediffsum;

if (ediffuz > 0) cincz = 0.0 - curincz * ediffuz/ediffsum;

else cincz = curincz * ediffuz/ediffsum;

newd = curd * cincd;

newk = curk * cinck;

newz = curz + cincz;

newerrsq = runexpt(newd, newk, newz);

if (newerrsq < minerrsq) {

minerrsq = newerrsq;

j = 4;

}

mewd = curd / cincd; /* Test the opposite direction in case we are */

mewk = curk / cinck; /* at the bottom of a diagonal trough */

mewz = curz - cincz;

mewerrsq = runexpt(mewd, mewk, mewz);

if (mewerrsq < minerrsq) {

minerrsq = mewerrsq;

j = 5;

}

if (j == 0) {

if (halve){

curincd = 1.5 - (curincd)/2.0;

curinck = 1.5 - (curinck)/2.0;

curincz = curincz/2.0;

dbl = FALSE;

} else {

curincd = 2.0 - curincd;

curinck = 2.0 - curinck;

curincz = 0.0 - curincz;

dbl = FALSE;

halve = TRUE;

}

}

if (j == 1) {

curd = testupd;

dbl = FALSE;

halve = FALSE;

}

if (j == 2) {

curk = testupk;

dbl = FALSE;

halve = FALSE;

}

if (j == 3) {

curz = testupz;

dbl = FALSE;

halve = FALSE;

}

if (j == 4) {

curd = newd;

curk = newk;

curz = newz;

if (dbl) {

curincd = 1.0 + (curincd - 1.0)*2;

curinck = 1.0 + (curinck - 1.0)*2;

curincz = 2*curincz;

}

dbl = TRUE;

halve = FALSE;

}

if (j == 5) {

curd = mewd;

curk = mewk;

curz = mewz;

dbl = FALSE;

halve = FALSE;

}

jold = j;

stepd = curincd - 1.0;

stepk = curinck - 1.0;

stepz = curincz;

}

zband = curz;

bestd = curd + 0.5; /* round rather than truncate */

intk = curk;

lasterrsq = runexpt((float)curd, curk, curz); /* to re-set the model trace for later */

}

#endif

float runexpt(float dl, float k, float z)

{

short i,j,m;

float h,p1,p2,p,e,pold,pz,p3,deltap,u,errsq,errsum, dfract;

float hdelay[31];

short dy;

dy = dl;

dfract = dl-dy; /* get the fractional remainder of the floating delay value */

errsq = 0.0; errsum = 0.0;

for(i=0;i<31;++i) hdelay[i] = 0.0; /* Ring buffer for CEV values */

h = 0.0; m = 0; pold = pz = p = ref; deltap=0.0;

for(i=0; i < datasize;++i) modelh[i] = 0;

for(j= -200;j<datasize;++j)

{

if (--m <= 0) m = 30;

i = abs(j);

hdelay[m] = h + distsign * (float)dist1[i];

p1 = hdelay[(dy+m)%30 + 1]; /* Assuming the delay is all perceptual! */

p3 = hdelay[(dy+m-1)%30 +1]; /* Added by MMT 950929 */

pz = p3*(1-dfract) + p1*dfract; /*MMT 950929 to centre derivative on same

/* moment as current perception */

e = ref - p;

deltap = (pold - pz)/2.0; /* pz is one sample time before p,

/* pold one sample time after p */

h += k*e + z*deltap; /* pold and deltap added 950929 MMT */

pold = p; p = pz;

if (h > 1000.0) h = 1000.0;

if (h < -1000.0) h = -1000.0;

if(j < datasize && j >= 0)

{

modelh[j] = (short)h;

u = (float)(modelh[j] - realh1[j]);

if (valid[i]) {

errsum += u;

errsq += u*u;

}

}

}

errsq = errsq - errsum*errsum/validsize;

return errsq;

}