MathGroup Archive 2008

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

Search the Archive

Symbolic Linear Function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91457] Symbolic Linear Function
  • From: yatesd at mac.com
  • Date: Fri, 22 Aug 2008 03:13:31 -0400 (EDT)

I could not find anything in this group or on the internet about
defining a generic linear function in Mathematica. I wanted a symbolic
simplification of an expression where I had an (undefined) function
that I knew was linear. I did the following:

SetAttributes[e,{Flat, Orderless}];
e[a_?NumericQ * x_]:= a * e[x];
e[x_Plus]:=e/@x;

This seemed to work fine and gave me the insight I wanted, but I was
wondering if other people have thought about this and have different
solutions or have any comments on my solution.

Thanks.

p.s. The expression I was interested in was Variance[Log[1+x]]. I
defined
Variance[x_]:=e[x^2]-e[x]^2 where e is representing expectation,
although I am not using any properties of expectation other than its
linearity.
I then looked at the Taylor expansion to order 5 with
Variance[Normal[Series[Log[1+x],{x,0,5}]]]


  • Prev by Date: Non Default stylesheet format and syntax coloring
  • Next by Date: Help to remove equivalent (redundant) solutions from FindRoot[]
  • Previous by thread: Re: Extending running memory of Mathematica
  • Next by thread: Help to remove equivalent (redundant) solutions from FindRoot[]