Re: partitioning into equiprobable intervals
- To: mathgroup at smc.vnet.net
- Subject: [mg41058] Re: [mg41013] partitioning into equiprobable intervals
- From: Bobby Treat <drmajorbob+MathGroup3528 at mailblocks.com>
- Date: Wed, 30 Apr 2003 04:24:13 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Here are a couple of loops, depending on what form the answer should be in. << Statistics`NormalDistribution` mean = 2.1; sigma = 1.5; dist = NormalDistribution[mean, sigma]; pdf = PDF[dist, x] cdf = CDF[dist, #] &; n = 10; N@Table[Quantile[dist, k/n], {k, 0, n}] low = -Infinity; intervals = Table[{low, low = Quantile[dist, k/n]}, {k, 1, n}]; N@intervals and here's a colorful plot of the result. << Graphics`Graphics` << Graphics`FilledPlot` Off[$MaxExtraPrecision::"meprec"] nSig = 5; {low, high} = mean + nSig*sigma{-1, 1}/2; DisplayTogether[intervals /. {a_, b_} :> {Max[a, low], Min[b, high]} /. {a_, b_} :> FilledPlot[pdf, {x, a, b}, Fills -> {Hue@cdf@b}]]; Hue can be replaced by GrayLevel. Changing "mean" and "sigma" changes everything, and "nSig" is the number of standard deviations to be plotted. Bobby -----Original Message----- From: susanlcw at aol.com To: mathgroup at smc.vnet.net Subject: [mg41058] [mg41013] partitioning into equiprobable intervals Hi all, I am interested in taking a normal distribution with mean and standard deviation known, and partitioning it into n equiprobable intervals. This means that the area under the curve on each interval will be 1/n. I know how to define the pdf, but I am at a loss as to how to design some type of loop (?) that will accomplish this task. I would greatly appreciate any suggestions. Thanks, Susan