model-based control, again

------------------- ASCII.ASC follows --------------------
[Hans Blom, 950601]

(Bill Powers (950531.0845 MDT))

Something finally sank in. ... How simple!

You got it! Once you truly understand something it IS simple,
although to others it may be abacadabra...

My way of modeling a simple control system must have puzzled you
greatly, because customarily I have represented the environmental
feedback connection as a simple constant, without in any way
indicating what approximation is hidden by this representation.

No, I'm familiar with your way of modeling. It is the classical,
basic approach to control, and it demonstrates that control can work
well even if our assumptions about the "world" are inaccurate --
which my demo shows as well. Part of what I wanted to demonstrate is
that if our knowledge (world-model) about how we can influence what
is out there improves, control can become even better. One aspect of
that is that sensory information that does not contribute to better
control (observation "noise") can and should be disregarded. The
classical approach is not able to do that; Kalman Filtering can,
because it incorporates learning of what part of the observation is
significant (can be used in control) and what not (what can and must
be disregarded).

An aside re influence vs. control, a discussion topic of sometime ago
in which I did not participate: I think that a discrimination between
the two is useless. In a model-based control approach, we can only
"influence" if there are unmodelled dynamics that "influence" the
state of the world as well. We can "control" (in the sense of fully
determine) only if the map fully coincides with the territory --
which can never be the case except in artificial worlds that we built
ourselves and thus known up to the smallest detail.

Note that the loop gain of this system is Kf/Kf = 1.0.

The notion "loop gain" is not applicable here. It is an important
notion in the basic, classical approach, but not here. See the ANOVA
explanation discussion below.

There is only one problem: we must know d in advance in order to
compute the correct o to cancel it, and build that value of d into
the equation of the controller.

You got it! Replace "know d in advance" by "have an internal model of
d" and you're there. For as far as d is not truly random, an internal
model CAN be built (see below), so the system will have at least
partial advance knowledge. The truly random part is of course unpre-
dictable/unanticipatable (is that a word?), but, BECAUSE it is truly
random, it will average out and for that reason can be disregarded.
Unless, of course, the amplitude of the truly random part of d is so
large that no good control is possible at all, whatever control
method one attempts to use.

If d is a function of time, d(t), then we must build d(t) into the
controller and time it so it is synchronized with the external d(t)
acting on qi.

You got it. That is part of what in the demo is called "prediction".
But prediction is possible only in so far as we can build a model of
d. The unpredictable part of d cannot be modelled and cannot be con-
trolled.

So we might easily come to the conclusion that a control system
can't resist disturbances that are not represented in the equation
of the control system. This seems to be your claim, Hans, and what
your professor from long ago taught you.

Yes. It correlates with the everyday observation that one cannot use
tools that one is not familiar with -- that one doesn't even recog-
nize as tools.

This explains a peculiarity in your program, the way the function
for computing the random noise variable is organized. This function
returns a new value of the random noise only on every second call;

Meta-remark: see how easy it is to come to an incorrect explanation
cq. world-model? It is a miracle that convergence to the correct
values sometimes occurs at all!

If the environmental feedback function is something other than a
constant of proportionality, then we can't necessarily use the same
form of the controller function, because of the system dynamics.

Exactly: the controller function depends on the system dynamics. That
is what I have attempted to get across for some time now, in diffe-
rent words: a "controller" is a (good) controller only in particular
environments. Or, equivalently, whether a system is a (good) con-
troller depends on the environment in which it finds itself.

The trick that Kalman Filtering attempts -- and often succeeds in --
is to get to know / learn / track the system dynamics in order to
adjust its controller function so that good, or even "optimal"
control results. Even if the environment is initially unknown. Even
if the characteristics of the environment change.

Whereas in PCT models YOU have to plug in gains, integration time
constants and such, in my demo equivalents of this are done automa-
tically.

That is probably more fooling around with Hans' model than anyone
wanted to read.

Bill, I was greatly, and very pleasantly, surprised to discover the
depth toward which you have analyzed what goes on in my demo. Few
people over thirty are still willing to learn complex new theories.
Inquisitive minds want to know. Yours sure is!

(Bill Powers (950531.1540 MDT))

... This bothers me. Why should an adaptive system need a friendly
external helper to tell it what variances to expect? If this is
intended as a model of an organism, there is certainly no such
friendly helper.

Why necessarily an "external" helper? It might be an INTERNAL helper,
one that we are genetically endowed with, or it might be a different
internal system, either at a higher hierarchical level or running in
parallel. The "world" and the model of my demo were very, very limit-
ed -- yet still complex enough to be almost incomprehensible to most
-- and I have only given hints that procedures are known to build
INTERNAL models of these variances.

I am not willing to go into all the details -- my discussions have
lost their interest for most readers of the list already. But to use
an analogy, although very different in detail: Compare the "extern-
al" information that is required about the noise variances with the
"external" information in the form of highest level reference level
settings that your PCT controllers need.

Considering the critical effects of these parameters, it seems
rather an anticlimax to find that the adaptive control system can't
find the right values itself.

No. As I said:

It is, however, possible to design methods to estimate the proper
values of pvv and pff if these cannot be pre-specified.

You're talking about an engineered system, not a living system.

Neither. I am talking about a feasibility proof: can it be done at
all? Therefore I engineer an (admittedly tiny) system and demonstrate
that an accurate world-model can be built based only on the informa-
tion that is obtained from observations (y) and actions (u), with
everything else internal "estimates"/guesses. And, that such a system
can learn to control from scratch (as a baby does), and can relearn
to control after major unpredictable changes in the world (as after
any type of life crisis). And, that it is not necessary for the
internal estimates to be "correct" (in the objective sense, i.e.
at=a, etc.) for control to be of good quality (as in neurosis). And,
that is possible to discover which part of our observations is useful
for control purposes and which part can be neglected.

Thus, besides "irrelevant side effects" I now introduce the notion
"irrelevant observations" (note: irrelevant only with respect to a
well defined goal or set of goals).

If we know that model-based control CAN be done, we can start looking
for its consequences in living systems. Evolution MIGHT have disco-
vered the same or similar mechanisms in its "survival of the fit-
test", which MIGHT coincide with an inexorable progression toward
living control systems that are ever better able to adjust their
"controller function" to their environment, i.e. better exploit their
niche.

It may help to know that a model-based controller will achieve con-
trol of a better quality -- in the mean square sense -- than your
classical type of controller, given an accurate model. That is why I
will not take you up on your offer to compare the quality of control-
lers designed by you and by me. Necessarily, your description of the
operating conditions of the controller (the "world" in which it
lives) would provide such an excellent model that you are bound to
loose such a contest :-).

It is difficult to get to understand Extended Kalman Filter theory
from playing with a demonstration, especially when you are
convinced that you can explain everything in terms of a different
theory (PCT versus SR, for instance :-).

I thought I was doing a pretty good job of trying to understand your
program, although I admit that my lack of familiarity with the
mathematical techniques is a handicap.

Yes, it seems that things suddenly snap into place. Your exclamation
"How simple!" might be a sign that in certain areas convergence has
taken place and "certainty" has been reached.

Basically, it is an on-line multiple regression estimation method,
very much like the ANOVA that psychologists are familiar with.

That isn't much help to me, as I have never used such methods.

OK, a basic explanation with an almost trivially simple example.
(Don't accuse me of being simplistic here; I know I am). This
procedure is for a single input single output system without
dynamics.

Assume that you have a set of pairs of observations y and actions u.
Plot those pairs:

    > *
^ | * *
> > * *
> > * * *
y | * *
    > * *
    > * *
    > *
    >
    >-------------------------
                  u ---->

Now fit a best straight line through those points. This line gives
you two parameters, offset and slope. That is the first step. Now
plot the residuals: the deviations of the points from the line of
best fit. The quality of the fit can be described in terms of the sum
of squares of the residuals. If this sum is zero, you have a perfect
fit. If the sum is small enough to your taste, you might be satisfied
at this point. If not, continue with fitting curves through the
residuals.

Obviously, a best straight line fit through the residuals would yield
a line with zero offset and zero slope; that doesn't help. But a
different function might be fitted: a square law curve, a parabola, a
sine, or what have you. If so, you have discovered a better fit with
more parameters. Plot the new residuals again and check whether they
are small enough. If not, iterate.

What results is a model y = f (u), maybe something like

  y = a + b * u + c * u * u
                                   -1
For control purposes, we need u = f (y), i.e. a method to compute
some u given a prescribed y. Inverting f isn't really necessary: the
fit may also be performed directly on u in terms of y rather than on
y in terms of u, yielding maybe something like

  u = d + e * y + f * sqrt (y)

Now imagine this same process in more dimensions -- y and u multi-
dimensional. If necessary, one can introduce "hidden variables" if
the system has dynamics, e.g. when there is a relation between y[i+1]
and y[i] (from here on, psychologists are usually flabbergasted). The
goals are the same, however: to discover a model y = f (u) and, for
control, the inverse of f.

Now the problem of searching for a best f is unconstrained and unim-
plementable for the general case. That changes when only a finite
subset of fitting functions is considered. Usually straight lines
suffice. If so, a particularly simple fitting procedure can be
implemented, something well within the complexity bounds of the
central nervous system.

That was ANOVA, much simplified. And please don't ask me about the
"hidden variables" thing... way too complex for a discussion list.

ft stands for everything that we cannot (or do not want to) model
and is, lacking more information, assumed to be best represented as
normally distributed zero average white noise ...

This is my main hangup. It seems that you have given up on actually
counteracting the disturbances in detail. If you represent the
disturance as a normally distributed zero average white noise, you
are not going to be modelling the actual perturbations that a real
environment induces in the controlled variable, and so will not be
able to build a system that can counteract them.

In my simplified ANOVA description, no more parameters can be extrac-
ted from the residuals as soon as the residuals resemble white noise.
As long as the residuals have more structure, a better model can be
built. I have indeed given up on actually counteracting white noise
disturbances, because that just is physically impossible in a causal
system (a system that cannot know the future).

The assumed disturbance is very different from real disturbances
encountered in a real world. It almost seems that you believe there
is no way to counteract unpredicted disturbances.

We are talking at cross purposes again: "real" disturbances that are
not white noise can be modelled (see the above procedure) until the
residuals ARE white noise, which cannot be modelled anymore.

Or are you speaking ONLY of the special case of a controller that
relies on an internal world-model, and realize that there are other
kinds of controller that don't need to make this approximation?

No, I am speaking in general. No controller, whatever the design, can
control away white SYSTEM noise (whereas white OBSERVATION noise can
be adequately rejected). But as soon as the noise shows more struc-
ture, that structure can be modelled and controlled away. In your PCT
models, you usually rely on such structure, often imposed by demand-
ing that the disturbances be low frequency. If the disturbance is low
frequency compared to the sampling rate/control interval, one partial
fit is obvious already: d [k+1] = d [k] doesn't "explain" everything,
but it IS a fine PARTIAL fit. An even better fit might be a linear
extrapolation of the line connecting the previous two values. Well,
you get the idea.

Basic in all these considerations is that you cannot know more than
what you have observed. The basic material for the model is the set
of y, u points. You can fully exhaust all information that is con-
tained in those data until only white noise residuals remain. BUT NO
MORE. Thus a variant of "it's all perception": "its all perception
and action".

In a real control system, the computed output is not just what is
required to bring the controlled variable to its reference level.

You are confusing "real" control systems with the type of control
system that you are familiar with (meta-remark: convergence should
not occur before all data are in). Let me assure you that there exist
REAL Kalman Kilter based control systems!

Well, this tells me that your model can work only in carefully
selected environments. That rather restricts its usefulness.

I keep trying to explain that EVERY controller is a controller only
in "carefully selected environments". That truly rather restricts the
usefulness of ANY "controller". You say essentially the same thing:

If the environmental feedback function is something other than a
constant of proportionality, then we can't necessarily use the same
form of the controller function, because of the system dynamics.

Can we finally agree on this?

Have you taken into account that a slow phenomenon can only be
learned slowly as well?

Have you determined that this is the correct explanation?

Yes. Let me explain. Assume that the disturbance is a very slow sine
wave that starts at zero. If you observe this disturbance over a
short time only, you will find an almost perfect fit with a straight
line segment. If convergence is too rapid, i.e. reached within this
short observation time interval, you have learned an incorrect model.
Given even the tiniest bit of random observation noise, there is no
way in which anybody (or any system) can establish that the disturb-
ance IS GOING TO BE a sinewave. The best prediction is the extra-
polation of the straight line. If the observation noise is finite,
this implies that the "true" world-variable will go to infinity.
Wrong conclusion! Only if convergence is forced to be slow enough
(based on enough data points) will it be possible to establish that
the disturbance is not correlated with any parameter that is useful
for control.

... If your system requires all disturbances to average to zero, you
are not designing a system for the real world.

You aren't getting this yet. A non-zero-average disturbance component
is EASY to model and EASY to control. In my u-y diagram above, just
shift all dots one position up or down. No problem: one offset para-
meter will have a different value but the model is not essentially
different.

Are you sure that you observed the rules concerning ft, pff, vt,

and pvv?

That was my point; no, I didn't.

Apply a theory to a domain where it isn't applicable and you get
funny results...

Can you explain why it is necessary to tell the model what
magnitude of disturbance to expect?

The model assumes TWO types of disturbances: one type (the
observation noise) must be disregarded, the other type (the
not yet modelled dynamics) is used to (further) tune the model
parameters. Very different things, which must be discriminated
between.

But the model isn't discriminating between them; the programmer
initializing the model is [by specifying pff and pvv].

That is true for my simple demo. Again, there are methods... Let's
not try conflagrate all hierarchical levels, before we even have the
basics right.

A hint: focus your attention on the two types of noise/uncertainty
and their very different natures; difficult but most enlightening.

Greetings,

Hans

<[Bill Leach 950601.21:46 U.S. Eastern Time Zone]

[Hans Blom, 950601]

Hans; I am at least a little conversant with the sort of modeling that
you are doing here but have not tried to keep up for quite a few years
now. Your modeling is of the generic class that was called "adaptive
control".

My own dwelling upon the discussions of the immediate past as well as
just plain trying to envision how such a system might be employed in a
living system has me pretty well convinced that some of the most
fundamental ideas implemented in you model probably are present in living
systems but also that it is highly unlikely that anything even remotely
similar to the methodology exists.

It is certainly possible that a form of matrix math _could_ be used in
the brain (at least an analog equivalent). Unless the existance of such
a filter could be tested because of use for some other purpose than
reducing white/pink noise, I suspect that it will be difficult at the
least to determine its' existance without being able to do a far finer
job of measuring neural input signals than presently possible.

In line with one of your statements:

If we know that model-based control CAN be done, we can start looking
for its consequences in living systems.

I can tell you that without a shadow of a doubt that Bill P. will
definately play the strongest devil's advocate that you have ever even
heard of much less encounter -- as I believe that he should.

It is upon you (or someone else for that matter) to first identify a
behavioural phenomenon that can not be explained using either a linear or
non-linear straight closed loop feedback control system _as_ extended by
HPCT. I believe that this task is insurmountable at the present state of
knowledge concerning HPCT.

The only examples that I have seen so far that point to the model control
concept are basically already in the HPCT model though the details are
lacking (and something like your adaptive control could be a candidate -
with the proviso from above) have been the cases for where control action
continues without immediate perception.

The other two examples that come to mind, spear fishing and heat
distortion are easily handled with the existing system.

Is there ANY evidence of superior perception in a living system than
should be possible given the system noise?

The truly random part is of course unpredictable/unanticipatable (is
that a word?), but, BECAUSE it is truly random, it will average out and
for that reason can be disregarded.

I think that the whole point of _having_ to have classic closed loop
feedback control is that IT is superior at handling random transients
that must be compensated. Living system control for most mechanical
activity is some many orders of magnitude lower in control accuracy to be
almost ludicrous. Engineered control systems people are looking for
accuracies that are obtained only by such extreme measures as age
characterizing transduces over various environmental conditions and then
factoring in the changes (and that is actually a gross oversimplification
of the sort of work that is actually being done).

Unless, of course, the amplitude of the truly random part of d is so
large that no good control is possible at all, whatever control method
one attempts to use.

One particular disturbance that is quite common for living systems
(particularly human) is for the system to encounter another system
controlling some aspect of the same CEV. This would be an unmodeled
dynamic (initially for certain) but could remain unmodeled as each system
modified its own control methods to obtain improved control of its' own
aspect.

Again you say;

But prediction is possible only in so far as we can build a model of d.
The unpredictable part of d cannot be modelled and cannot be controlled.

The WHOLE point of PCT is that we actually have observed that living
systems do quite well controlling completely unknown and unexpected
disturbances -- exactly the sort of thing that classic control systems do
well and modeled system do not.

I may well be "skating on thin ice here" but I believe that the following
is essentially incorrect:

Whereas in PCT models YOU have to plug in gains, integration time
constants and such, in my demo equivalents of this are done
automatically.

Being "one of the bad boys" that has not yet run any of the code, I don't
have the closer analysis that studying and comparing your own results to
those of others brings you but... It seems to me that the "set your
constants" and such is misleading.

The constants that are set are all grouped rather closely for any one
experiment and even for different experiments that "are of the same type"
but _seem_ to vary as the skill of the subjects vary.

A plausible explanation for more markedly different constant sets for
different types of experiments is that the number of perceptual levels
being modeled is varying. There is, of course, substantial evidence
(beyond the obvious stability needs of theory) that each successive level
up the hiearchy has a slower processing speed.

There is, I believe, already existing a consensus that a "tuning system"
of some sort exists and while your model does self-tune, I think that
its' poor response to random disturbance rules it out for the level where
turning would have to be occuring.

Why necessarily an "external" helper? It might be an INTERNAL helper,
one that we are genetically endowed with, or it might be a different
internal system, either at a higher hierarchical level or running in
parallel. The "world" and the model of my demo were very, very limited
-- yet still complex enough to be almost incomprehensible to most -- and
I have only given hints that procedures are known to build INTERNAL
models of these variances.

If I have even an inkling of where you are coming from, the externally
entered parameters should be no problem. Initial values could be learned
through experience in a manner similar to other learning.

My control system math is pretty bad now (not that it was ever very
impressive) but, I don't think that you want to take this bet:

Necessarily, your description of the operating conditions of the
controller (the "world" in which it lives) would provide such an
excellent model that you are bound to loose such a contest :-).

Remember, he can specify a series of response requirements to random
disturbance(s) for any arbitrary waveform(s) with rather wide dynamic
range in both the time and frequency domains. In addition he could
include random noise of various intensities that is not always present.

I believe that the "fixation" on "optimal control" is wholely
inappropriate for living systems (though as I have stated before... some
sort of modeling does occur).

If I understand the ANOVA stuff at all (and there is a better than even
chance that I don't) isn't this curve fit usually accomplished with a
specialized form of matrix math?

Argh! You are persistant!

We are talking at cross purposes again: "real" disturbances that are
not white noise can be modelled (see the above procedure) until the
residuals ARE white noise, which cannot be modelled anymore.

Not when they are random! The real noise is normally of a very low
amplitude and can be ignored. Living control system handle both the
situation where there much actually resist pink noise in one case and
ignore it in the other. Two simple examples come to mind:

When driving at moderately high speed on something like a gravel road or
even with a shimmy caused by the vehicle, the driver does not need to
control out this added disturbance.

When guiding an industrial cutter it IS necessary to compensate for the
much lower amplitude "oscillations" and this is done.

A resistance that YOU may be experiencing, is that as I understand it,
your model is quite limited in its' adaptability from what I am led to
believe could be possible. For example your Kalman filtering has only
one response rate where in actuality there could be several parallel
filters extracting different information concerning the changes seen in
"y".

In your PCT models, you usually rely on such structure, often imposed by
demanding that the disturbances be low frequency.

This is a reasonable demand and indeed is a requirement for the model to
behave in a manner consistant with measured behaviour on the part of the
living system. Achieving pico-second time response and 1 part in 10^15
accuracy would be kind of missing the point.

If the disturbance is low frequency compared to the sampling
rate/control interval, one partial fit is obvious already:
d [k+1] = d [k] doesn't "explain" everything, but it IS a fine PARTIAL
fit.

This is a serious matter as it is dealing with the basic problem in
trying to model an analog system using a digital one. At the real
response rates of the living system, simple control models running on
today's typical PC type computers are fast enough where each iteration of
the program code should involve a small enough change in any parameter
that uniquely digital error should not "sneak" in. As models become more
complex the danger increases (though at the present rate of progress
based upon the number of researchers and funding the computing hardware
should continue to outstrip the code -- unfortunately).

I don't know if I'll beat Rich and Bill to this one but what do you mean
by:

Thus a variant of "it's all perception": "its all perception and action".

Without trying to quote some more of your text... are you sure that you
could design a model based controller for one of the simpler PCT tests
and obtain similar results (including the sorts of changes made to the
typical experiment)?

-bill