Re: Error propagation expressions [message #27100 is a reply to message #27090] |
Tue, 09 October 2001 22:54  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
john.copley@nist.gov (John Copley) writes:
> Does anyone know of, or has anyone written, an IDL procedure that takes an
> input string expression such as
> "w4=w1+4*w2/(w3+con)"
> and creates an output string expression that expresses the variance of
> the quantity on the left hand side?
> In this case the output string expression would be something like
> "v4=v1+16*((w3+con)^2*v2+w2^2*v3)/(w3+con)^4.
> In these expressions wi, where i is an integer, e.g. w4, represents a
> quantity whose variance is vi, e.g. v4.
> Other quantities, e.g. con in the above expressions, are treated as
> constants.
> The assumption is that variances add, i.e. standard deviations add
> root mean square.
> I am looking for a routine that can handle arbitrarily complicated
> combinations of (at least) addition, subtraction, multiplication and
> division.
As for the moon buddy! :-) You are asking for answers to hard
questions on things like parsing, algebra, calculus, etc. If you
really need an expression like that, then you might be able to use
some of the automatic derivative codes that have been developed for
FORTRAN (look up "automatic differentiation"), but these won't be
useful in dynamic compilation situations.
If you don't actually need an expression, but just need to establish
confidence limits, then you might be able to take an empirical or
monte carlo approach. For example, sample the parameter values at a
grid of values, plug them into the equation using EXECUTE() and find
out the variation in the function.
Hope this helps!
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|