Re: Triangular Distribution in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg74243] Re: [mg74204] Triangular Distribution in Mathematica
- From: Darren Glosemeyer <darreng at wolfram.com>
- Date: Thu, 15 Mar 2007 05:03:58 -0500 (EST)
- References: <200703140850.DAA25031@smc.vnet.net>
negedea at googlemail.com wrote: > Dear all, > > Does any one know how to use triangular distribution in Mathematica? > Does any one have an add-in? Or a formula that works? I want to get > the PDF function, plot and the first four moments, mean, variance, > skew, kurtosis. I have the following parameters for the distribution > minimum value 270, maximum 415 and likeliest or mode 392. > > Thanking in Adavance, > > Negede > > Here is a definition for the triangular distribution pdf along with computations for the mean, variance, skewness and kurtosis and the plot command for your particular distribution. In[1]:= $Post=InputForm; Out[1]//InputForm= Null In[2]:= trianglePDF[min_, max_, mode_, x_] := Piecewise[{{(2*(-min + x))/((max - min)*(-min + mode)), min <= x <= mode}, {(2*(max - x))/((max - min)*(max - mode)), mode < x <= max}}] Out[2]//InputForm= Null In[3]:= mu = Integrate[x*trianglePDF[270, 415, 392, x], {x, 270, 415}] Out[3]//InputForm= 359 In[4]:= var = Integrate[(x - mu)^2*trianglePDF[270, 415, 392, x], {x, 270, 415}] Out[4]//InputForm= 6073/6 In[5]:= Integrate[(x - mu)^3*trianglePDF[270, 415, 392, x], {x, 270, 415}]/ var^(3/2) Out[5]//InputForm= (-493416*Sqrt[6/6073])/30365 In[6]:= Integrate[(x - mu)^4*trianglePDF[270, 415, 392, x], {x, 270, 415}]/ var^2 Out[6]//InputForm= 12/5 In[7]:= Plot[trianglePDF[270, 415, 392, x], {x, 270, 415}] Darren Glosemeyer Wolfram Research
- References:
- Triangular Distribution in Mathematica
- From: negedea@googlemail.com
- Triangular Distribution in Mathematica