Probability Models and the Data Generating Process
By the end of this topic
You will be able to distinguish Bernoulli, Gaussian, and count structures according to the shape of the observed values. You will be able to use a probability model not as a definitive account of the actual biological mechanism, but as an assumption for thinking about how the observed data were generated.
Starting point: the shape of the values hints at the question
Depending on whether the outcome is a single success/failure, a continuous measurement, or a count over a fixed period, the possible data structures differ. If you treat every value as normally distributed or handle every positive integer as if it were continuous, you can miss the range and the variability structure of the data.
A probability model is not a label that describes a single observation. It is an explicit assumption about which values can occur, what the conditions are, and where the variability comes from. Once you choose a model, you must check how well the data and the assumptions agree.
Three structures
Bernoulli: a single binary outcome
A structure in which one observation is recorded as one of two outcomes. For example, whether or not a set criterion was passed can be expressed as 0 and 1. Here the mean of the values can be read as the success proportion, but you must first define what each observation means as an independent unit.
Gaussian: one model for continuous measurements
A structure that assumes continuous values vary around some center and spread. Whether actual measurements follow this structure must be confirmed through the question, the units, and distribution checks. The name Gaussian does not guarantee that the measurements are necessarily bell-shaped, nor does it automatically resolve tails and repeated-measures structure.
Count: counts and integer values
A structure recorded as integers of 0 or greater, such as the number of occurrences in a fixed observation window. If observation time or exposure differs, a simple comparison of counts may not carry the same meaning. The relationship among counts, rate, and offset is covered more concretely in the later GLM topic.
Asking through the data-generating process
Before choosing a model, fill in the following sentences.
ํ ํ์ __________________ ๋จ์์ ๊ด์ธก์ด๋ค.
outcome์ __________________ ์ ๊ธฐ๋กํ๋ค.
๊ฐ๋ฅํ ๊ฐ์ ๋ฒ์๋ __________________ ์ด๋ค.
๋ณ๋์ __________________ ์ __________________ ์์ ์๊ธธ ์ ์๋ค.
๊ด์ธก ๊ธฐํ ๋๋ ๋
ธ์ถ๋์ __________________ ์ด๋ค.These sentences fix the data structure before any mathematical formula. For example, if observation times differ in count data, you must separate whether a difference in values reflects a difference in event rates or a difference in observation opportunity.
Distinguishing Parameters from Observations
In a probability model, values such as p, loc, scale, and lam serve as the settings or parameters that generate the data. The binary, continuous, and counts you actually observe are samples drawn under those settings. If you do not distinguish the two, you end up reading a once-observed mean as a fixed truth about the population.
For example, two samples generated with the same p=0.35 can have different success proportions. This is because the samples differ. Conversely, similar means do not guarantee the same generating structure. Distinguishing sampling variation from model assumptions is the starting point for understanding sampling distributions later on.
Independence Is Not Contained in the Name of a Distribution
Two observations taking Bernoulli-style values of 0 and 1 are not automatically independent of each other. Values arising from the same biological unit, the same batch, or the same time course can share common variation. The same holds for Gaussian or count structures: the range of values and independence are different questions.
Accordingly, record the data generating process in two layers, as follows.
๊ฐ์ ํํ: binary | continuous | count
๊ด์ธก ๊ด๊ณ: ๋
๋ฆฝ ๋จ์ | ๋ฐ๋ณต ์ธก์ | ๊ทธ๋ฃนยท์๊ฐ ๊ตฌ์กฐEven when the choice of distribution looks correct, ignoring the observational relationships can change how standard errors and uncertainty are interpreted.
Simulating the Shape of a Model in Python
Synthetic data can be used to check the shape of a distribution. When generating random numbers with numpy.random.Generator, record the seed and the generation rules.
import numpy as np
rng = np.random.default_rng(20260806)binary = rng.binomial(n=1, p=0.35, size=100)continuous = rng.normal(loc=5.0, scale=1.2, size=100)counts = rng.poisson(lam=3.0, size=100)
print(binary.min(), binary.max())print(continuous.mean(), continuous.std())print(counts.min(), counts.max())This output is used to check the possible values of the three structures and to summarize the synthetic sample. The result of a single simulation does not prove that the model is true. p, loc, scale, and lam are the generating settings for this example, not parameter estimates from actual research.
When varying the simulation, change only one setting at a time. Changing p lets you see how the success proportion of the binary outcome moves, and changing scale lets you see how the spread of the continuous values changes while the center stays the same. Changing lam alters the typical magnitude and frequency structure of the counts. These experiments are used to understand the model's sensitivity; they do not automatically find the parameters that fit real data.
Fixing the random seed lets you recreate the example with the same code and environment. However, fixing the seed does not mean fixing the measurement process, the input data, the library versions, and the entire analysis code. In a reproducibility record, keep the environment lock, the generating code, and the data schema along with the seed.
Differences Between the Model and Actual Observations
Real data may come with measurement limits, group structure, time, batch, missingness, and selection processes. Even if a simple Gaussian model roughly represents the center of the data, independence or the variance structure may not hold.
Therefore, distinguish the following.
- The forms of values the model allows
- The distribution the data actually shows
- Independence between observational units
- Variation the model cannot explain
The way to check these differences is to compare the shapes expected from the model's predictions or simulations against the range, distribution, and group structure of the actual observations. A mismatch in this comparison does not immediately license writing that "the data are wrong." Re-examine measurement units, missingness, batch, time structure, and model choice in turn.
Using a model does not mean that all of this has been resolved; it is closer to disclosing which assumptions were used.
Returning to the Research Question for Interpretation
A probability model is not a statement that "this condition operates through such-and-such a biological mechanism." It is an abstraction chosen to express the measurement form and variation of the current data. To interpret a model's parameters, you must consider units, opportunity for observation, study design, and the link function together.
Even if you perform an elaborate computation that fits the wrong data structure, the interpretation of the result may stray from the question. In the next installment, we connect sampling and repeated sampling variation through simulation.
Common Failures and How to Check Them
- Do not automatically select Gaussian merely because a value is continuous.
- Do not conclude that something is independent Bernoulli merely because it was coded as 0 and 1.
- Do not compare counts without separating them from observation time.
- Do not use the result of a single simulation as evidence about the true parameter.
- Do not write as if the name of a model resolves an error in study design.
Key Points
- The value form of the outcome is the starting point for thinking about the data-generating process.
- Bernoulli, Gaussian, and count represent different assumption structures.
- A probability model is an abstraction for analysis, not a determination of a biological mechanism.
- Synthetic simulation is a tool for understanding the possible shapes of a model.
- After checking the unit of observation and the variation structure, the suitability of the model should be examined.
On to the Next Topic
In the next installment, we look at how a value computed from a single sample fluctuates when the sample changes. We connect sampling distributions and standard errors to the data-generating process.
References
- NIST/SEMATECH e-Handbook: https://www.itl.nist.gov/div898/handbook/
- SciPy statistics reference: https://docs.scipy.org/doc/scipy/reference/stats.html
- NumPy Reference: https://numpy.org/doc/stable/reference/
The simulation rules and explanations in this article are an educational composition written independently by BioStatPy.