Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

defining averages over unknown PDF

  • To: mathgroup at
  • Subject: [mg131941] defining averages over unknown PDF
  • From: Sune <sunenj at>
  • Date: Mon, 4 Nov 2013 23:16:59 -0500 (EST)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

Dear all.

I want to do some symbolic manipulations of an expression involving averages over a stochastic variable with an unknown density. Therefore, I figured I could define a function av, which would correspond to the average over this unknown parameter density function.
I did as follows:
av[y_ + z_, x_] := av[y, x] + av[z, x]?
av[c_ y_, x_] := c av[y, x] /; FreeQ[c, x]
av[c_, x_] := c /; FreeQ[c, x]

So these are basic properties of the average over the distribution of X. Some things work okay, for example
In[52]:= av[Exp[-x y], x]?
Out[52]= av[E^(-x y), x]
In[79]:= D[av[-x y, x], x]?
Out[79]= -y
In[80]:= D[av[-x y, x], y]?
Out[80]= -av[x, x].

However, the most vital part for my calculations does not work:
In[81]:= D[av[Exp[-x y], x], y]?
Out[81]= -E^(-x y) x

It should have been av[-Exp[-x y] x,x].

Any clues to what I'm doing wrong? I'm thinking that I need to specify some rules for differentiation, but I don't know how. But then I'm wondering how come it got the other expressions for differentiation right.

  • Prev by Date: Re: Finding branches where general solution is possible
  • Next by Date: Re: Round-off error?
  • Previous by thread: Re: ListPlot - assigning a list of colors to a set of points
  • Next by thread: Re: defining averages over unknown PDF