Statistics & probability

Ewens partition probability calculator with allele count profiles

Calculate Ewens partition-profile probabilities, block-count distributions and next-observation predictions.

Your numbers

Valid JSON; preserve the shown array or object structure.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

An Ewens profile records how many allele types appear once, twice, three times and so on in a sample. The entry a-j is the number of types represented by exactly j sampled individuals.

THE FORMULAInputalleleprofilea_jnonnegativeintegerswithΣj a_j=n. Ewenssamplingprob=n!/thetaRising(n)*Π_j(theta^a_j/(j^a_j*a_j!));loggammaform forfactorialsandΣlog(theta+i). NumberallelesK=Σa_j. Optionalcompleteprofiles enumerateintegerpartitionsofn withstatecap andsum1. Thisisprobabilityofunlabeledcountprofile,notoneparticularlabeledsetpartition; latterlosescombinatorialmultiplicity.

A worked example

With the prefilled inputs, expectedBlocks = 1.8333333333333333.

Good to know

Unlabeled Ewens sampling partition law; counts a_j are numbers of blocks of size j. Numeric log/probability mode, not exact rational output.

Describe an allele-count profile

An Ewens profile records how many allele types appear once, twice, three times and so on in a sample. The entry a-j is the number of types represented by exactly j sampled individuals.

The weighted sum of j times a-j must equal the sample size. The ordinary sum of the a-j entries instead gives the number of distinct observed allele types.

Ewens profile normalizationEwens n=3, θ=1: profile probabilities sum to one1/3one size-3 block1/2size 2 + size 11/6three singletons1/3 + 1/2 + 1/6 = 1; these are unlabeled profiles.
Scroll across to see the full diagram.
The three unlabeled sample-size3 profiles have exact probabilities1/3,1/2,1/6 at theta1. Their sum is one.

Compare with the Occupied boxes probability calculator for random allocations. Compute exchangeable random-partition probabilities under the Ewens sampling formula, including block-count profiles; fixed labeled boxes give a different sampling law.

Choose the mutation-diversity parameter

Use the prefilled input structure and preserve the declared column or index order. The positive parameter theta controls the model's balance between repeated types and the appearance of distinct types. It belongs to a particular neutral sampling model, rather than being a generic probability of mutation for one draw.

Different biological or partitioning processes can require different distributions. The calculation evaluates the stated Ewens model and does not estimate theta or verify neutrality from a single entered profile. The profile input lists a1, a2 and so on, where aj is the number of blocks of size j. Its weighted sum must equal the sample size. For example, the profile [1,1] at n equal to three describes one singleton and one two-element block, not the labeled assignment of three particular observations. The concentration parameter theta is positive and controls the tendency to introduce new blocks. This page concerns exchangeable random partitions under the Ewens law; it does not infer mutation mechanisms or estimate theta from a single observed profile.

Distinguish a profile from a labeled partition

A profile groups together all sample arrangements with the same block-size counts. A specific labeled partition identifies which individual observations share each type and has a different probability.

This distinction explains the factorial and block-size factors in the formula. Counting every labeling again after using a profile probability would multiply the same combinatorial arrangements twice.

Evaluate products in logarithms

The expression combines a sample factorial, a rising product of theta and one factor for each occupied block size. Direct factorial arithmetic overflows quickly, even when the final probability is moderate.

Logarithms and log-gamma functions preserve these products and ratios. A very small probability can then be displayed on a log scale instead of being mistaken for a mathematically impossible profile.

The complete three-observation example

With sample size three and theta one, a single type of size three has probability one-third. A size-two type together with a singleton has probability one-half.

Three singleton types have probability one-sixth. These three profiles exhaust the integer partitions of three, and their probabilities sum to one, giving an exact normalization check.

Read the number of types correctly

The profile determines a realized count of distinct types, but many different profiles can share that count. A distribution for the total type count must sum probabilities across all compatible profiles.

Likewise, the most likely complete profile need not contain the most likely number of types. Those are different summaries of the same sampling distribution and should be labeled separately. A zero profile count is legitimate and contributes no block of that size.

Keep sampling assumptions visible

The formula describes exchangeable sample partitions under its particular neutral model. Population structure, selection and other departures can change the observed diversity pattern.

Use the result as a transparent model probability, not as a stand-alone assessment of biological plausibility. Comparing an observed profile with a fitted scientific model requires additional data and parameter reasoning. The block-count distribution is built recursively by the Chinese-restaurant new-block probability theta divided by theta plus the number already seated. Its expectation is the sum of those predictive probabilities, while the optional complete profile uses the Ewens factorial weight. These are different output summaries of the same partition law. The next-observation new-block probability is separate from the probabilities of joining blocks in each existing size class. Computation uses logarithms and numeric probabilities rather than an exact rational mode. Profile order, omitted trailing zeros and the distinction between labeled and unlabeled partitions should be fixed before comparing an external combinatorial count. Unlabeled Ewens sampling partition law; counts a_j are numbers of blocks of size j. Numeric log/probability mode, not exact rational output.

A few questions, answered

What does a2 mean?

It is the number of distinct types represented exactly twice, not the number of individuals in those types.

Why must the weighted profile sum to n?

Each type represented j times contributes j individuals to the sample.

Is this the probability of one particular labeling?

No. The profile probability already combines all arrangements with the same block-size counts.

Can theta be zero?

The stated finite-parameter formula requires theta strictly positive; limiting cases need separate treatment.

Find your calculator

Start typing to explore the library.