How to define an arbitrary discrete probability distribution with a list of mass without warnings?

Could convert the list of weights to a Piecewise, and feed that to ProbabilityDistribution wts = {2/3, 1/3}; toPiecewisewts_, x_ := PiecewiseMapIndexed{#1, x == #21} &, wts In178:= f = ProbabilityDistributiontoPiecewisewts, x, {x, 1, 2, 1} Out178= ProbabilityDistribution Piecewise{{2/3, \FormalX == 1}, {1/3, \FormalX == 2}}, 0, {\FormalX, 1, 2, 1} Daniel Lichtblau.

Could convert the list of weights to a Piecewise, and feed that to ProbabilityDistribution. Wts = {2/3, 1/3}; toPiecewisewts_, x_ := PiecewiseMapIndexed{#1, x == #21} &, wts In178:= f = ProbabilityDistributiontoPiecewisewts, x, {x, 1, 2, 1} Out178= ProbabilityDistribution Piecewise{{2/3, \FormalX == 1}, {1/3, \FormalX == 2}}, 0, {\FormalX, 1, 2, 1} Daniel Lichtblau.

Thank you for your answer. It works, and I learned a new function MapIndexed! – skum Nov 10 at 18:34.

You may want to use EmpiricalDistribution when constructing a distribution from a list of values: empiricalDistribution = EmpiricalDistribution{2/3, 1/3} -> {1, 2} and you can then use this in other statistical and visualization functions: PlotCDFempiricalDistributionx, {x, 0, 4} The function ProbabilityDistribution is more appropriate when you have a pdf.

Thank you for your answer. I tried this, and it indeed worked! I wish I was able to accept both Daniel's and your answers.

– skum Nov 10 at 21:19.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions