9696Xstar = BootstrapRV (X .variate (n = 100 ))
9797PlotDist (CDF (X ))
9898PlotDist (CDF (Xstar ))
99- plt .title ('Comparison of Exponential CDF and Bootstrapped EDF' )
99+ plt .title ('Comparison of Exponential CDF and Bootstrapped EDF' )
100+
101+ # Queue
102+ X = ExponentialRV (Rational (1 ,3 ))
103+ Y = ExponentialRV (Rational (1 ,2 ))
104+ Q = Queue (X ,Y ,n = 3 ,k = 2 ,s = 3 )
105+ Q .display ()
106+
107+ # RV Algebra
108+ X = ExponentialRV (Rational (1 ,2 ))
109+ Y = ExponentialRV (Rational (1 ,3 ))
110+
111+ Z = X + Y
112+ Z .display ()
113+
114+ Z = X - 4
115+ Z .display ()
116+
117+ Z = - Y
118+ Z .display ()
119+
120+ U = UniformRV (Rational (1 ),Rational (3 ))
121+ U2 = UniformRV (Rational (4 ),Rational (5 ))
122+ Z = U * U2
123+ Z .display ()
124+
125+ Z = U / 4
126+ Z .display ()
127+
128+ Z = U ** 3
129+ Z .display ()
130+
131+ U = UniformRV (Rational (1 ),Rational (2 ))
132+ U2 = UniformRV (Rational (3 ),Rational (4 ))
133+ Z = Convolution (U ,U2 )
134+ Z .display ()
135+
136+ Z = ConvolutionIID (U ,3 )
137+ Z .display ()
138+
139+ X = UniformRV (Rational (2 ),Rational (4 ))
140+ Y = UniformRV (Rational (3 ),Rational (5 ))
141+ Z = Product (X ,Y )
142+ Z .display ()
143+
144+ Z = ProductIID (X ,3 )
145+ Z .display ()
146+
147+ # Random Variable Methods
148+
149+ X = TriangularRV (2 ,4 ,7 )
150+ X .verifyPDF ()
151+ Y = RV ([x ** 2 ],[0 ,10 ],['continuous' ,'pdf' ])
152+ Y .verifyPDF ()
153+
154+ X = BinomialRV (5 ,0.25 )
155+ X .display ()
156+ Convert (X )
157+
158+ T = TriangularRV (1 ,4 ,6 )
159+ T .display ()
160+ T .latex ()
161+
162+ U = UniformRV (Rational (1 ),Rational (2 ))
163+ Z = ConvolutionIID (U ,3 )
164+ Z .display ()
165+ Z .simplify ()
166+
167+ # Saving Random Variables
168+ X = ExponentialRV (Rational (1 ,3 ))
169+ Y = ExponentialRV (Rational (1 ,4 ))
170+ Z = X + Y
171+ Z .save ('conv.rv' )
172+
173+ X = LoadRV ('conv.rv' )
174+ X .display ()
175+
176+ # Statistics
177+
178+ X = NormalRV (2 ,2 )
179+ data = X .variate (n = 30 )
180+ KSTest (X ,data )
181+
182+ mu = Symbol ('mu' )
183+ sigma = Symbol ('sigma' ,positive = True )
184+ X = NormalRV (mu ,sigma )
185+ data = NormalRV (0 ,2 ).variate (n = 40 )
186+ MLE (X ,data ,[mu ,sigma ])
187+
188+ theta = Symbol ('theta' ,positive = True )
189+ kappa = Symbol ('kappa' ,positive = True )
190+ W = WeibullRV (theta ,kappa )
191+ data = WeibullRV (2 ,4 ).variate (n = 40 )
192+ MOM (W ,data ,[theta ,kappa ],guess = [2.2 ,3.8 ],numeric = True )
193+
194+ # Transform
195+
196+ X = TriangularRV (Rational (2 ),Rational (4 ),Rational (5 ))
197+ gX = [[x ** 2 ,x ** 2 ],[- oo ,0 ,oo ]]
198+ Y = Transform (X ,gX )
199+ Y .display ()
200+
201+ # Truncation
202+
203+ X = BetaRV (2 ,2 )
204+ Y = Truncate (X ,[Rational (1 ,4 ),Rational (3 ,4 )])
205+ Y .display ()
206+
207+ # Variate Generation
208+
209+ X = TriangularRV (2 ,4 ,10 )
210+ X .variate (n = 5 )
211+ X .variate (n = 5 ,method = 'inverse' )
212+ X .variate (s = .5 ,method = 'inverse' )
0 commit comments