Data generating process
A data generating process (DGP) is the real-world process that produces the data a researcher observes. For example, the waiting times of riders at a bus stop come from the bus schedule and from when riders reach the stop.[1] Researchers usually cannot see the process directly, so they describe it with a model, a set of possible DGPs that can each be simulated with random numbers, and use the data to learn about it.[1][2]
A statistical model is a guess about the DGP, and conclusions drawn from it are only as good as that guess.[3] Statisticians still debate whether a model should be treated as the real process.[4][5]
Process, population, and data
The DGP is what statistical analysis is usually trying to learn about.[1] It sits behind the data in two steps.
Sample, population, and DGP
The CourseKata textbook separates three levels, from the data in hand back to the process.[1]
| What it describes | How it relates to the others | |
|---|---|---|
| Sample | The units actually selected and measured, the data set in hand | Usually treated as drawn from a larger population |
| Population | The larger group the sample comes from | Shaped by the DGP |
| DGP | The process that makes the population look the way it does | Sits one step further back than the population |
Populations as processes
Some populations are not fixed lists waiting to be sampled. The riders at a bus stop change constantly, so it makes more sense to treat the population as the result of a process playing out over time.[1] One textbook describes the DGP as many causal factors, each with some chance of occurring, that together produce the population over time.[1]
Example: waiting for a bus
The same textbook uses 60,000 waiting times recorded at a bus stop at Fifth Avenue and 97th Street in New York City.[1] Most riders wait a short time, because many are regulars who roughly know the schedule and try to arrive just before the bus. A rider who arrives just after a bus leaves waits longest, until the next one comes.[1]
Data versus the DGP
Data are concrete and in hand, while the DGP is unknown.[1] Data give clues about the process, but they never give a perfect picture of it.[1]
Describing a DGP with probability
A DGP is usually written as a fixed, systematic part plus a random part. The random part stands for all the factors the researcher cannot or does not want to model in detail.[3]
A regression example
The simplest linear regression model writes each observation as
- is the outcome for observation , such as household consumption in year .
- is an explanatory variable, such as households' disposable income in the same year.
- and are parameters, unknown numbers shared by all observations.
- is the error term, which is never observed.
The error term is treated as a random variable, a quantity whose value is set by chance.[3]
The randomness stands in for details the researcher does not know. Davidson and MacKinnon describe this as using randomness to model our ignorance of the details of the real mechanism.[3]
A common assumption is that has expectation zero whatever the value of . The expectation of a random variable is its long-run average over many repeated draws. This assumption usually determines the parameters, so the equation can hold only for specific values of and .[3]
A time-series example
A candidate DGP has consequences that can be checked in the data. In the white noise model, each value of a series is
- is the constant mean of the process.
- is an independent, identically distributed draw from a normal distribution with mean 0 and variance .[6]
If this were the true DGP, the series would show no trend over time and no correlation between one value and the next.[6] A clear trend in the data would therefore count against the model.
A DGP as a recipe for simulation
One exact way to define a DGP is as something a computer can simulate. Davidson and MacKinnon describe a DGP as something that provides a unique recipe for simulation.[2] For the regression model above, the recipe runs as follows:[3]
- Fix the sample size, .
- Choose values for the parameters and .
- Obtain values of , either from real data or from another simulation.
- Compute the systematic part, , for each .
- Choose a probability distribution for the error terms, along with any parameters such as its mean and variance. The distribution gives the chances of each possible error value.
- Use a random-number generator to draw independent error terms . Independent means that knowing one error does not change the chances of another.
- Add each error term to the systematic part to get the simulated .
Step 5 matters because specifying only the mean of the errors does not specify their distribution in full.[3] Davidson and MacKinnon call a model a fully specified parametric model if it can be simulated once its parameter values are known. A partially specified parametric model needs more information before simulation is possible.[3]
If the simulated model is correctly specified, the simulation matches the real world, because it uses the same mechanism that generates the real data.[3] This is the basis of the simulation methods described in "Uses" below.
Models as sets of DGPs
In the formal view, a model is a set of DGPs rather than a single one. Davidson and MacKinnon define a model this way and write a single DGP as and a model as .[2] On this page the true DGP is written .
Why a model is a set
A model is a set because it usually leaves its parameters unknown. Davidson and MacKinnon distinguish models by how much their member DGPs can vary.[2]
| Kind of model | How its DGPs can differ |
|---|---|
| Purely parametric | Only in their parameter values |
| Not purely parametric | In their parameter values and also in the distribution of the random elements |
Estimation uses the data to choose parameter values, and so picks particular members of the set.[5]
Correct and incorrect specification
This view separates two questions. One is which member of the model best fits the data, and the other is whether the true DGP is in the model at all. When the family of distributions in the model contains the true distribution, the model is called correctly specified; otherwise it is misspecified.[7]
When the true process is not in the model
A researcher chooses a family of distributions that may or may not contain the true one.[7] Halbert White's 1982 paper studied what maximum likelihood estimates mean in the second case.
The pseudo-true value
White showed that the quasi-maximum likelihood estimator, maximum likelihood applied to a possibly wrong model, converges to a well-defined limit that may or may not be consistent for the parameters of interest.[7] Under the conditions given below, it is consistent for
- is the true density of an observation , set by the real DGP. A density is a function that shows how likely each possible value is relative to the others.
- is the model's density for parameter value .
- is the set of allowed parameter values.
- The expectation is the Kullback-Leibler divergence of the model from the truth, a measure of how different two probability distributions are.
White's result rests on specific conditions. The two key ones are that the observations are independent and identically distributed, and that is the unique value that minimizes the divergence.[7]
The value is often called the pseudo-true parameter value. It picks out the distribution in the model that is most similar to the one that generated the data, measured by this divergence.[8]
A correct model is the special case. When the model does contain the true distribution at some value , maximum likelihood is consistent for under suitable conditions.[7]
What still works and what breaks
A wrong model can still estimate some quantities well. Correct specification is enough, but not required, for consistent estimates of particular parameters.[7]
The normal model gives an example. Maximum likelihood under an assumed normal distribution is the same as least squares, which chooses the coefficients that make the sum of squared gaps between observed and fitted values as small as possible. It gives consistent estimates of the mean and variance even when the true distribution is not normal, as long as those quantities are finite.[7]
Other errors do break estimates. Leaving out a relevant variable that is correlated with (tends to vary together with) the included explanatory variables, such as , makes linear regression estimates inconsistent.[7]
The three standard likelihood-based tests of restrictions on parameters are each invalid under misspecification:[7]
- the Wald test
- the Lagrange multiplier test
- the likelihood ratio test
White gave more general statistics that stay valid, along with tests for detecting misspecification.[7]
All models are wrong
George Box held that no model is exactly the true process. He wrote in 1976 that "all models are wrong", and the full aphorism, "All models are wrong, but some are useful", appears in a 1979 paper of his.[9] On this view, the practical question is whether a model is close enough to the DGP to be useful.
Uses
Simulation studies
Simulation studies are computer experiments that create data by sampling with computer-generated random numbers.[10] The researcher writes the DGP, so the truth is known.
Knowing the truth lets researchers judge a method. Because the true parameter values come from the generating process, researchers can measure properties such as bias, the amount by which an estimate exceeds the true value on average.[10]
Morris, White, and Crowther prefer the term "data-generating mechanism" for how random numbers are used to build a data set. They avoid "data-generating model" because it implies parametric models, only one kind of mechanism.[10]
There are two main kinds of mechanism. Data can come from parametric draws from a known model or from resampling a real data set, where the true mechanism is unknown.[10]
Parametric draws are far more common. In the authors' review of 100 articles from volume 34 of Statistics in Medicine, 97 simulation studies used a parametric model and 3 used resampling.[10]
The bootstrap
The bootstrap replaces the unknown true DGP with one estimated from the data. Bootstrap methods estimate a model many times using simulated data, and the procedure that generates these samples is called a bootstrap DGP.[11]
A bootstrap test works only as well as its bootstrap DGP matches the true DGP.[11] What matters is the features of the true DGP that affect the test statistic, the number computed from the data to carry out the test.[11]
Machine learning
Machine learning theory usually makes only a weak assumption about the DGP. In Leo Breiman's account, the one assumption is that the data are drawn independently and identically distributed from an unknown multivariate distribution, a probability distribution for several variables taken together.[5]
The generalization error is defined against this unknown distribution. It is the expected loss of a prediction rule on new cases drawn from the same distribution as the training data, where loss measures how wrong a prediction is.[5]
Breiman describes two ways to estimate it:[5]
- Use a test set, data held back from fitting and used only to measure prediction error.
- Use cross-validation, which fits the model on part of the data and measures the error on the rest, repeating this several times.
The guarantee depends on new data coming from the same process. The joint distribution of inputs and outputs gives the probabilities of inputs and outputs taken together. When it differs between training and testing, the problem is called dataset shift.[12]
Debates about the term
Two cultures
Breiman argued in 2001 that statisticians lean too heavily on assumed DGPs. In "Statistical Modeling: The Two Cultures", he split statistical modeling into two camps.[5]
The data modeling camp checks its models in two ways:[5]
- Goodness-of-fit tests, which check whether the data look like draws from the model.
- Residual checks, which look for patterns in the residuals, the gaps between observed values and the model's fitted values.
| Data modeling culture | Algorithmic modeling culture | |
|---|---|---|
| View of the DGP | A probability model with random noise, such as response = f(predictors, random noise, parameters) | Complex and unknown |
| Goal of the model | Estimate parameters, then use the model for information or prediction | Find an algorithm that predicts |
| How models are checked | Goodness-of-fit tests and residual checks | Predictive accuracy |
| Breiman's estimate of members | 98% of statisticians | 2% of statisticians, many in other fields |
Breiman's main warning was that conclusions from a fitted model are about the model's mechanism, not nature's.[5] If the model imitates nature poorly, the conclusions may be wrong.[5]
He also noted that different models can fit the same data about equally well yet tell different stories.[5] He called this the Rashomon effect, the existence of many equally good-fitting models.[5]
Models versus true processes
Some statisticians object when a model is called "the" DGP. Rob Hyndman notes that econometricians commonly use the phrase to describe a statistical model.[4]
Hyndman stresses how far real processes are from models. He writes that real data come from a complicated, messy process that is nonlinear (does not follow a straight-line pattern), nonstationary (its statistical patterns change over time), and non-Gaussian (does not follow a normal distribution).[4] In his view a model is at best a rough stand-in for that process.[4]
Other econometricians keep the true DGP and the model apart on purpose. The probabilistic reduction approach of Aris Spanos treats the actual DGP as the main object of modeling.[13] It separates the phenomenon itself (the actual DGP) from the theory model and from the estimable model, a version of the theory model that can be estimated with the available data, to avoid confusing the phenomenon with our attempts to describe it.[13]
References
- 3.3 The Data Generating Process, CourseKata, Statistics and Data Science: A Modeling Approach.
- Foundations of Econometrics, Part 1, Russell Davidson and James G. MacKinnon, 2021.
- Econometric Theory and Methods, Russell Davidson and James G. MacKinnon, 2021 edition.
- I am not an econometrician, Rob J Hyndman, Hyndsight blog.
- Statistical Modeling: The Two Cultures, Leo Breiman, Statistical Science 16(3), Project Euclid, 2001.
- Chapter 18: The data-generating process, Time Series and Forecasting: A Project-based Approach with R, bookdown.org.
- Maximum Likelihood Estimation of Misspecified Models, Halbert White, Econometrica 50(1), pp. 1 to 25, 1982.
- Consequences of Model Misspecification for Maximum Likelihood Estimation with Missing Data, Econometrics 7(3), MDPI, 2019.
- Did George Box say, "All models are wrong, but some are useful"?, Rick Wicklin, The DO Loop, SAS Blogs, 2025.
- Using simulation studies to evaluate statistical methods, Tim P. Morris, Ian R. White, and Michael J. Crowther, Statistics in Medicine, 2019.
- Bootstrap Methods in Econometrics, James G. MacKinnon, Queen's Economics Department Working Paper 1028 (published in Economic Record), 2006.
- Dataset Shift in Machine Learning, Joaquin Quiñonero-Candela and others (eds.), MIT Press, 2009.
- Two Approaches to the Model Specification Problem in Econometrics, Aris Spanos and Anya M. McGuirk, AgEcon Search, 2001.
