Statistics
RandomVariable
create new random variable
Calling Sequence
Parameters
Description
Examples
References
RandomVariable(T)
T
-
ProbabilityDistribution; probability distribution
The RandomVariable command creates new random variable with the specified distribution.
The parameter can be one of the supported distributions or a distribution data structure.
with(Statistics):
Create a random variable which is normally distributed with mean a and standard deviation b.
X := RandomVariable(Normal(a, b));
X≔_R
PDF(X, t);
2⁢ⅇ−t−a22⁢b22⁢π⁢b
Mean(X);
a
T := Distribution(GammaDistribution(u, v));
T:=moduleoptionDistribution,Continuous;exportConditions,ParentName,Parameters,CharacteristicFunction,CGF,Mean,Mode,MGF,PDF,Support,Variance,CDFNumeric,QuantileNumeric,RandomSample,RandomSampleSetup,RandomVariate,MaximumLikelihoodEstimate;end module
Y := RandomVariable(T);
Y≔_R0
PDF(Y, t);
0t<0tuv−1⁢ⅇ−tuu⁢Γ⁡votherwise
U := Distribution(PDF = (t -> piecewise(t < 0, 0, t < 3, 1/3, 0)));
U:=moduleoptionDistribution,Continuous;exportPDF,Conditions;end module
Z := RandomVariable(U);
Z≔_R1
PDF(Z, t);
0t<013t<30otherwise
Mean(Z);
32
Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.
See Also
Statistics[Computation]
Statistics[Distribution]
Statistics[Distributions]
Statistics[RandomVariables]
Statistics[Specialize]
Download Help Document
What kind of issue would you like to report? (Optional)