RE: Digest for EUforum at topica.com, issue 5467

new topic     » topic index » view thread      » older message » newer message

> 
> posted by: Al Getz <Xaxo at aol.com>
> 
> Juergen Luethje wrote:
> > 
> > Al Getz wrote:
> > 
> > > I've used so called 'sensitivity' analysis in the past to 
> measure changes
> > > in functions with respect to a given variable and this 
> helped understand
> > > things better sometimes especially when human error is involved.
> > > 
> > > For example....
> > > 
> > > for the equation with some function F:
> > >   y=F(a,b,c)
> > > 
> > > the sensitivity with change of parameter 'a' might be 100 
> times as great
> > > as with parameter 'b', and perhaps the sensitivity with 
> respect to 'c'
> > > might be 1000 times lower than with 'a', meaning y hardly changes
> > > with 'b' or 'c' but changes quite a bit with parameter 'a'.  Thus,
> > > the error in measurement in 'b' or 'c' doesnt matter as 
> much as with
> > > the error in 'a'.  This would mean great care should be 
> used in measuring
> > > 'a' while with 'b' or 'c' you might get away with 
> estimating from other
> > > parameters or whatever.
> > 
> > Interesting!
> > Do you have a link at hand that explains sensitivity 
> analysis more in
> > detail? smile
> > 
> > Regards,
> >    Juergen
> 
> Hi Juergen,
> 
> Sorry i dont have a link in mind, but a quick google turned up several
> sites including a 'forum' for Sens A.  I didnt want it to sound too
> complicated though, because basically it's not, so here's a quick
> example to help show how simple it can really be....
> 
> First a pure approach then a numerical approach that can be used in
> an Eu program...
> 
> I think a good example would be finding the volume of a rather long
> box with rectangular cross section we'll say the length of is 'a',
> and the two sides are 'b' and 'c'.  This would look like a rectangular
> pipe.  We want to find the volume, but also the change in volume so
> we can understand what happens when either of the measurements for
> a,b, and c are either off to begin with (due to measurement 
> inaccuracies)
> or just to see what happens when a given dimension changes.
> 
> For this example we'll say
>   a=100
>   b=10
>   c=10
> in inches.
> 
> The volume would be v=a*b*c which we'll rewrite
>   y=a*b*c
> 
> First we take first partials:
>   dy/da=b*c
>   dy/db=a*c
>   dy/dc=a*b
> 
> and now we can call the sensitivities:
>   Sya=dy/da=b*c
>   Syb=dy/db=a*c
>   Syc=dy/dc=a*b
> 
> Where 'Sya' is read: "The sensitivity of y with respect to a".
> 
> Now we look at the actual numerical value of these to see what
> we can find out:
>   Sya=b*c=100
>   Syb=a*c=1000
>   Syc=a*b=1000
> 
>  From this we can quickly see that Sya is ten times less than Syb or
> Syc, so the measurement in 'a' isnt as important as the measurement
> for 'b' or 'c'.
> 
> Going back to the original equation with the chosen values for this 
> example, we can see that a change of say 1/16 inch causes a much
> bigger change in volume when the change occurs in either b or c, while
> not as big of a change in volume when the change occurs in a.
> 
> Writing this out as a 'formula' we get an approximate numerical
> method:
>   Sya=(f(a+inc,b,c)-f(a,b,c))/inc
>   Syb=(f(a,b+inc,c)-f(a,b,c))/inc
>   Syc=(f(a,b,c+inc)-f(a,b,c))/inc
> where
>   f(a,b,c)=a*b*c (the original volume equation), and
>   'inc' is a small number like 0.001.
> 
> The above can be used in a program quite easily, but usually 
> a slightly
> more accurate method is used in programs (the 'Central Means' 
> formula):
>   Sya=(f(a+inc,b,c)-f(a-inc,b,c))/(inc+inc)
>   Syb=(f(a,b+inc,c)-f(a,b-inc,c))/(inc+inc)
>   Syc=(f(a,b,c+inc)-f(a,b,c-inc))/(inc+inc)
> All that's involved here is calling the function f twice for each
> sensitivity: once using a positive inc and once a negative inc,
> then subtracting the results and dividing by twice the inc.
> 
> 
> Take care,
> Al
> 
> And, good luck with your Euphoria programming!
<snip>

There are two caveats to this approach.

1/ For the results of the above formula to be meaningful, inc has to be
"small enough" so that the nonlinear effects (measured by the higher partial
derivatives) not to need attention. You then need a methd to roughly bound
the magnitude of 
valid inc's, ie vamues for which the 1st order error terms are useful.

To see what's happening there, assume the pipe is strictly circular, so that
its section is PI*a*a instead of a*b. What matters is not PI, but the
nonlinear a*a.

2/ Numerical computation of derivatives is a problem, because you usually
incur important underflows when computing the differences in the numerator.
You'd better restrict the families of f's you'll be operating on, and then
use some more or less exact forlmula that gets rid of the underflow problem,
that is, which does not substract two large terms to get their difference.

CChris

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu