1 years, 45 days

## How to properly invert and add scale and...

Maple 2023

Hello community,

Could I please get help on how to invert a probability distribution (reciprocal of) and add the location and scale parameters? The distribution in question is from the built-in (Statistics package) of ChiSquare(n) transformed into a scaled inverse Chi Square with location (shift) parameters.

I have tried the following which results in verified (correct) empirical (sampled) data, but have not been equally successful in the theoretical moments and its quantiles.

 >
 > restart; st:=time():
 > with(Statistics):
 >
 > InvChi2:=proc(a,b,n)         description "inverse chisquare distribution with a=location, b=scale, n=degrees of freedom";         local CHI := RandomVariable(ChiSquare(n)):                  Distribution(                 CDF = unapply(CDF(b*n/CHI+a,t),t),                 PDF = unapply(PDF(b*n/CHI+a,t),t),                 Mean = a+~Mean(b*n/CHI),                 Median = a+~Median(b*n/CHI),                 Variance = simplify(CentralMoment(a+b*n/CHI,2)),                 Skewness = simplify(CentralMoment(b*n/CHI, 3) / CentralMoment(b*n/CHI,2)^(3/2)),                 Kurtosis = simplify(CentralMoment(b*n/CHI, 4) / CentralMoment(b*n/CHI,2)^2),                 Conditions = [b > 0],                 RandomSample = proc(N::nonnegint)                                 a+~Sample(b*n/CHI,N)                         end proc                 );         end proc:
 >
 > T:= RandomVariable(InvChi2(2,4.32,3))
 >
 >
 (1)
 > evalf(Median(T))
 (2)
 > evalf(Mean(T))
 (3)
 > Variance(T)
 (4)
 > Skewness(T)
 (5)
 > Kurtosis(T)
 (6)
 > Quantile(T,.25)
 (7)
 > A:=Sample(T,10^5):
 > Median(A)
 (8)
 > Mean(A)
 (9)
 > Variance(A)
 (10)
 > Skewness(A)
 (11)
 > Quantile(A,.25)
 (12)
 > Quantile(A,.75)
 (13)
 > printf("Time to execute worksheet = %a seconds", time() - st)
 Time to execute worksheet = 2.813 seconds
 >

Thank you

## How do I re-parameterize a triangular di...

Maple 2023

Hi community!

In the mw file attached, I have worked a numerical solution to get the standard parameters of minimum and maximum of the distribution Triangular(a,b,c) given 2 quantiles (and its values) and c.  The code works and was simple.  Now, how do I solve this more elegantly to have the reparameterization directly inputed instead of indirectly by solving a & b first (like the attached file does)? Thanks people,altTriangular2.mw

## How do I make the Beta "Subjective" Dist...

Maple 2023

Hello community, I am new in this forum and sorry if the following seems rudimentary:

I am replicating a distribution function using Statistics[Distribution] as defined here:

Vose Software's Beta Subjective

I have tested numerically and the function works for this initial values: Min := 3; Mlikely := 8; Avg := 9; Max := 18;

But failed to complete with these values (which I tested works in another software) Min := 1000; Mlikely := 1400; Avg := 1500; Max := 2100;

What puzzles me is the inconsistency of handling the functions (be aware that the server kernel could be slow at times). I hope I don't have to give up and continue my custom distribution project in another software.

Here is the document:

The Beta Subjective Distribution

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

 (7)

 (8)

 (9)

 (10)

 (11)

 (12)

 (13)

 (14)

 (15)

 (16)