Commands for Computing Properties of Random Variables
|
The Statistics package provides a wide range of tools for working with random variables. This includes tools for creating random variables from specific distributions, commands for computing basic quantities, and related functions, simulation and visualization routines.
|
|
Creating New Random Variables
|
|
•
|
Random variables are created using the RandomVariable command.
|
>
|
X := RandomVariable(Normal(5, 1));
|
| (1) |
>
|
Y := RandomVariable(Normal(7, 1));
|
| (2) |
•
|
Random variables can be distinguished from ordinary variables (names) by their attributes. Type RandomVariable can be used to query whether a given Maple object is a random variable or not.
|
>
|
type(X, RandomVariable);
|
| (3) |
>
|
type(Z, RandomVariable);
|
| (4) |
>
|
indets(X+Y+Z, RandomVariable);
|
| (5) |
|
|
Computing with Random Variables
|
|
•
|
The Statistics package provides a number of tools for computing basic quantities and functions. Single random variables as well as algebraic expressions (e.g. linear combinations, products, etc.) involving random variables are supported. Different random variables involved in an expression are considered to be independent. By default, all computations involving random variables are performed symbolically.
|
|
|
Examples
|
|
>
|
|
Compute the PDF and the CDF of the non-central beta distribution.
>
|
|
| (6) |
>
|
|
| (7) |
Compute the PDF, mean, standard deviation and moments of a Beta random variable.
>
|
|
| (8) |
>
|
|
| (9) |
>
|
|
| (10) |
>
|
|
| (11) |
>
|
|
| (12) |
Create two normal random variables.
>
|
|
| (13) |
>
|
|
| (14) |
Compute the density of X/Y. Compare the result with the Cauchy density.
>
|
|
| (15) |
>
|
|
| (16) |
Compute some probabilities.
>
|
|
>
|
|
| (17) |
The speed distribution for the molecules of an ideal gas.
>
|
|
>
|
|
| (18) |
>
|
|
| (19) |
>
|
|
| (20) |
Create random variable having this distribution.
>
|
|
| (21) |
Compute average molecular speed.
>
|
|
| (22) |
Compute average kinetic energy.
>
|
|
| (23) |
Helium at 25C.
>
|
|
| (24) |
>
|
|
>
|
|
Most probable speed.
>
|
|
Warning, solutions may have been lost
| |
| (25) |
Use simulation to verify the results.
>
|
|
| (26) |
>
|
|
| (27) |
>
|
|
>
|
|
>
|
|
|
|
Download Help Document
Was this information helpful?