Re: Error propagation expressions [message #27090] |
Wed, 10 October 2001 05:42 |
Randall Skelton
Messages: 169 Registered: October 2000
|
Senior Member |
|
|
On 9 Oct 2001, John Copley wrote:
> 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.
> I look forward to your thoughts!
> John Copley
>
I believe you can do this with Matlab using Maple for the analytic
derivation part. What you are asking for is a symbolic algebra package
and IDL is not such a tool. If you knew of a C/Fortran program that did
this, i.e. takes a string algebric expression and generates its
multivariant differential, you could write a simple DLM to communicate
with the C/Fortran code and achive your desired result. Try searching
google and the Scientific Applications for Linux page for a free
interpreter of symbolic manipulation. I know Kalamaris (GPL) does
symbolic derrivatives so perhaps you could borrow the symbolic algebra
package from them... Then talk to Ronn Kling (or buy his book) about
writing DLMs.
Good luck,
Randall
|
|
|
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
------------------------------------------------------------ --------------
|
|
|