Re: how to find a1,a2...an for the goal value?
- From: ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx (Roger Stafford)
- Date: Fri, 01 Jun 2007 22:49:49 GMT
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
.
- Follow-Ups:
- Re: how to find a1,a2...an for the goal value?
- From: lightfive
- Re: how to find a1,a2...an for the goal value?
- From: lightfive
- Re: how to find a1,a2...an for the goal value?
- References:
- Re: how to find a1,a2...an for the goal value?
- From: Roger Stafford
- Re: how to find a1,a2...an for the goal value?
- From: lightfive
- Re: how to find a1,a2...an for the goal value?
- Prev by Date: Re: roifill (or equivalent) in 3-d?
- Next by Date: Could not reserve enough space for object heap / java app
- Previous by thread: Re: how to find a1,a2...an for the goal value?
- Next by thread: Re: how to find a1,a2...an for the goal value?
- Index(es):
Relevant Pages
|
Loading