Mathematica 9 is now available
2.1 Getting Started

The mathStatica package adds over a hundred new functions to Mathematica. But 95% of the time, we can get by with just 4 of them:

[Graphics:../Images/Rose_mathStatica_gr_1.gif]

Table 0: Core functions for a random variable [Graphics:../Images/Rose_mathStatica_gr_2.gif] with density [Graphics:../Images/Rose_mathStatica_gr_3.gif]

This ability to handle plotting, expectations, probability, and transformations, with just 4 functions, makes the mathStatica system very easy to use, even for those not familiar with Mathematica.

To illustrate, let us suppose the continuous random variable [Graphics:../Images/Rose_mathStatica_gr_4.gif] has probability density function (pdf) [Graphics:../Images/Rose_mathStatica_gr_5.gif], where [Graphics:../Images/Rose_mathStatica_gr_6.gif]. In Mathematica, we enter this as:  

[Graphics:../Images/Rose_mathStatica_gr_7.gif]

This is known as the Arc-Sine distribution. Here is a plot of [Graphics:../Images/Rose_mathStatica_gr_8.gif]:

[Graphics:../Images/Rose_mathStatica_gr_9.gif]

[Graphics:../Images/Rose_mathStatica_gr_10.gif]

Fig. 0: The Arc-Sine pdf

Here is the cumulative distribution function (cdf), [Graphics:../Images/Rose_mathStatica_gr_11.gif], which also provides the clue to the naming of this distribution:

[Graphics:../Images/Rose_mathStatica_gr_12.gif]
[Graphics:../Images/Rose_mathStatica_gr_13.gif]

The mean, [Graphics:../Images/Rose_mathStatica_gr_14.gif], is:

[Graphics:../Images/Rose_mathStatica_gr_15.gif]
[Graphics:../Images/Rose_mathStatica_gr_16.gif]

while the variance of [Graphics:../Images/Rose_mathStatica_gr_17.gif] is:

[Graphics:../Images/Rose_mathStatica_gr_18.gif]
[Graphics:../Images/Rose_mathStatica_gr_19.gif]

The [Graphics:../Images/Rose_mathStatica_gr_20.gif] moment of [Graphics:../Images/Rose_mathStatica_gr_21.gif] is [Graphics:../Images/Rose_mathStatica_gr_22.gif]:

[Graphics:../Images/Rose_mathStatica_gr_23.gif]
[Graphics:../Images/Rose_mathStatica_gr_24.gif]

The moment generating function (mgf) of [Graphics:../Images/Rose_mathStatica_gr_25.gif] is [Graphics:../Images/Rose_mathStatica_gr_26.gif] :

[Graphics:../Images/Rose_mathStatica_gr_27.gif]
[Graphics:../Images/Rose_mathStatica_gr_28.gif]

Now consider the transformation to a new random variable [Graphics:../Images/Rose_mathStatica_gr_29.gif] such that [Graphics:../Images/Rose_mathStatica_gr_30.gif]. By using the Transform and TransformExtremum functions, the pdf of [Graphics:../Images/Rose_mathStatica_gr_31.gif], say [Graphics:../Images/Rose_mathStatica_gr_32.gif], and the domain of its support can be found:  

[Graphics:../Images/Rose_mathStatica_gr_33.gif]
[Graphics:../Images/Rose_mathStatica_gr_34.gif]
[Graphics:../Images/Rose_mathStatica_gr_35.gif]

So, we have started out with a quite arbitrary pdf [Graphics:../Images/Rose_mathStatica_gr_36.gif], transformed it to a new one [Graphics:../Images/Rose_mathStatica_gr_37.gif], and since both density g and its domain have been inputted into Mathematica, we can also apply the mathStatica tool set to density [Graphics:../Images/Rose_mathStatica_gr_38.gif].