Re: how to find a1,a2...an for the goal value?



In article <1180681033.091392.156140@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
lightfive <aold2@xxxxxxxxxxxx> wrote:

Great thanks to Roger Stafford and Walter Roberson.

My question is :

g(x)=3Df1(a1,x)+f2(a2,x)+...+fn(an,x) =A3=A8n is about 10=A3=A9

In order to get good linearity of g(x) in section [a,b],that is,the
g'(x)@[a,b] is a predetermined=A3=A8or specified ,expect =A3=A9 value=A3=AC=
or to
say=A3=ACmaybe a value range ,how to find a1,a2...an to get wanted g(x)?

The below link show the function graph,
http://www.newsmth.net/att.php?p.191.118368.399.jpg

Please give me a direction. Or could you tell me to which mathematical
model my question belong? Someone advise me to use Newton method or
conjugate gradient method. But I don't know the details and how to use
them in matlab.

Thanks again!
-------------------------
There are still aspects of your question that are unclear to me.
However, I am guessing you mean the following. You have a continuous
function g(x) with n parameters, a1, a2, ..., an. You wish to find the
values of these parameters that make g(x) the most nearly linear in a
given x-interval [a,b]. I interpret the latter to mean that for any given
set of parameters there is a linear function of x for which the mean
square difference between it and g(x) is a minimum. You wish to so adjust
the parameters that this minimum value is minimized. Have I got that
right?

I will attempt to answer this question only to the extent of computing,
for any particular set of parameters, the mean square difference, v,
between g(x) and a best-fitting linear function in the above sense. I
leave the rest of the optimization to you. Presumably you can then call
on 'fminsearch' in an appropriate manner for finding the desired optimum
set of parameters using this v as the quantity to be minimized.

For a given set of parameters do this. Calculate

gm = 1/(b-a) * integral, x = a to b, g(x) dx
c = 12/(b-a)^3 * integral, x = a to b, (g(x)-gm)*(x-(a+b)/2) dx
v = 1/(b-a) * integral, x = a to b, (g(x)-gm-c*(x-(a+b)/2))^2 dx

The quantity v is the mean square difference between g(x) and the
best-fitting linear function on [a,b]. The quantity gm is the mean value
of g(x) on [a,b], and c is the slope of the best-fitting linear function
to g(x).

To demonstrate the above, let c*x+d be an arbitrary linear function.
Then the mean square difference between it and g(x) over [a,b] is

v = 1/(b-a) * integral, x = a to b, (g(x)-c*x-d)^2 dx

At a minimum, the partial derivative of v with respect to d must be zero, so

d = 1/(b-a) * integral, x = a to b, g(x) dx -
c/(b-a) * integral, x = a to b, x dx =
gm - c*(a+b)/2

Substituting in this value of d, we get

v = 1/(b-a) * integral, x = a to b, (g(x)-gm - c*(x-(a+b)/2))^2 dx

Now differentiating with respect to c and setting the derivative to zero gives

integral, x = a to b, (g(x)-gm)*(x-(a+b)/2) dx =
c * integral, x = a to b, (x-(a+b)/2)^2 dx =
c * ((b-a)^3/24-(a-b)^3/24) = c*(b-a)^3/12

which yields the above optimum value for c.

Roger Stafford
.



Relevant Pages

  • Re: Simple Sagnac
    ... In the frame of the train, ... > |> There is no linear relationship between t and tau and you've ... > |> cuckoo transforms are linear? ... > | A linear function of two variables is the sum of a constant times ...
    (sci.physics.relativity)
  • Re: Regression significance conundrum
    ... >>> linearly correlated with x, then there is a linear functional ... with a "linear function model between Y and X". ... about not knowing what a linear regression model is! ... >>NOW about how you SERIOUSLY erred about what correlation measures. ...
    (sci.stat.math)
  • Re: Why momentum is a cotangent vector?
    ... elements of fibers are called momentum vectors. ... I have no special knowledge here, but in general, co-vectors are linear ... L is a function from velocities to reals. ... To get a linear function out of it, ...
    (sci.physics)
  • Re: FIGHT! FIGHT! FIGHT!
    ... requirements of a linear function when applied to network theory." ... Linear means the graph of the function is a straight line. ... In y = mx + b, m is a constant determining the slope of the line. ...
    (rec.radio.amateur.antenna)
  • Re: how to find a1,a2...an for the goal value?
    ... square difference between it and gis a minimum. ... between gand a best-fitting linear function in the above sense. ... gradient method is a choice. ...
    (comp.soft-sys.matlab)

Loading