« View all new features in Mathematica 9  previous  |  next 
New in Mathematica 9Built-in Integration with R

Seed Random Number Generation and Visualization 

In[1]:=
Click for copyable input
X

Generate random normally distributed numbers with a fixed seed.

In[2]:=
Click for copyable input
X
Out[2]=

Package this as a function.

In[3]:=
Click for copyable input
X

Test the function.

In[4]:=
Click for copyable input
X
Out[4]=

Since the seed is fixed, the same seed value always returns the same pseudo-random sequence.

In[5]:=
Click for copyable input
X
Out[5]=

Generate a set of random numbers.

In[6]:=
Click for copyable input
X
Out[6]=

Test them for normality with Mathematica's QuantilePlot.

In[7]:=
Click for copyable input
X
Out[7]=

And with EstimatedDistribution.

In[8]:=
Click for copyable input
X
Out[8]=

Visualize the result.

In[9]:=
Click for copyable input
X
Out[9]=

Use the dynamic interactivity of Mathematica for data analysis. The random numbers are generated in R but analyzed and visualized in Mathematica.

In[10]:=
Click for copyable input
X
Out[10]=