Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.1K Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

[?] Compute and use the gaussian variance formula?

Posted 9 years ago

Hey,

I've already made a similar discussion, but since I do not get any answers there, I decided to start a new one with more details. Please apologize that.

I have the function

El[k_ , l_, d_] := k * l / (0.25*d^2*Pi)

and defined the gaussian variance formula

Eld [k_, l_, d_, kd_, ld_, dd_] := 
 Sqrt[kd (Derivative[1, 0, 0][El])^2 + 
   ld (Derivative[1, 0, 0][El])^2 + dd (Derivative[1, 0, 0][El])^2]

It works pretty well for El... El[1,2,3] (just some random numbers for the variables to try it out) gives me 0.282942.

However, Eld[1, 2, 3, 4, 5, 6] doesn't work, which makes sense because Eld can't give k,l and d to El. However, I need to first derivate the function by hand (or wolfram alpha) and then write the full code into Eld. Do you know how to solve this issue?

Thank you,

Tobias

POSTED BY: Epsilon Tau
4 Replies
POSTED BY: Neil Singer
Posted 9 years ago
POSTED BY: Jim Baldwin
Posted 9 years ago

I have not heard of the term "gaussian variance" before but I suspect you mean that you want to use the Delta Method (as it is known to statisticians) which is equivalent to the Propagation of Error (as it is known to some engineers and physicists). If k, l, and d are statistically independent of each other (or at least their covariances are zero), then you could use the following:

El[k_, l_, d_] := k l/(d^2 \[Pi]/4)
Eld[k_, l_, d_, kd_, ld_, dd_] := Module[{vk, vl, vd, f, \[CapitalSigma]},
  f = (D[El[vk, vl, vd], {{vk, vl, vd}}]) /. {vk -> k, vl -> l,  vd -> d};
  \[CapitalSigma] = DiagonalMatrix[{kd, ld, dd}];
  Sqrt[FullSimplify[f.\[CapitalSigma].f]]]

Eld[k, l, d, kd, ld, dd]
(* (4 Sqrt[(4 dd k^2 l^2+d^2 (kd l^2+k^2 ld))/d^6])/\[Pi] *)
Eld[1, 2, 3, 4, 5, 6]
(* (4 Sqrt[95/3])/(9 \[Pi]) *)
POSTED BY: Jim Baldwin
Posted 9 years ago

Thanks a lot, it works perfectly! Now I'm trying to understand what the hell you did there :D But I'm sure I'll understand it with a some hours of work so that I can solve problems like this in the future myself.

POSTED BY: Epsilon Tau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard