Representing continuous probability distributions

后端 未结 10 1976
天命终不由人
天命终不由人 2021-01-30 14:27

I have a problem involving a collection of continuous probability distribution functions, most of which are determined empirically (e.g. departure times, transit times). What I

10条回答
  •  旧巷少年郎
    2021-01-30 15:27

    Some initial thoughts:

    First, Mathematica has a nice facility for doing this with exact distributions.

    Second, representation as histograms (ie, empirical PDFs) is problematic since you have to make choices about bin size. That can be avoided by storing a cumulative distribution instead, ie, an empirical CDF. (In fact, you then retain the ability to recreate the full data set of samples that the empirical distribution is based on.)

    Here's some ugly Mathematica code to take a list of samples and return an empirical CDF, namely a list of value-probability pairs. Run the output of this through ListPlot to see a plot of the empirical CDF.

    empiricalCDF[t_] := Flatten[{{#[[2,1]],#[[1,2]]},#[[2]]}&/@Partition[Prepend[Transpose[{#[[1]], Rest[FoldList[Plus,0,#[[2]]]]/Length[t]}&[Transpose[{First[#],Length[#]}&/@ Split[Sort[t]]]]],{Null,0}],2,1],1]

    Finally, here's some information on combining discrete probability distributions:

    http://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/Chapter7.pdf

提交回复
热议问题