
Inprobability theory andstatistics, a collection ofrandom variables isindependent and identically distributed (i.i.d.,iid, orIID) if each random variable has the sameprobability distribution as the others and all are mutuallyindependent.[1] IID was first defined in statistics and finds application in many fields, such asdata mining andsignal processing.
Statistics commonly deals with random samples. A random sample can be thought of as a set of objects that are chosen randomly. More formally, it is "a sequence ofindependent, identically distributed (IID) random data points."
In other words, the termsrandom sample andIID are synonymous. In statistics, "random sample" is the typical terminology, but in probability, it is more common to say "IID."
Independent and identically distributed random variables are often used as an assumption, which tends to simplify the underlying mathematics. In practical applications ofstatistical modeling, however, this assumption may or may not be realistic.[3]
Thei.i.d. assumption is also used in thecentral limit theorem, which states that the probability distribution of the sum (or average) of i.i.d. variables with finitevariance approaches anormal distribution.[4]
Thei.i.d. assumption frequently arises in the context of sequences of random variables. Then, "independent and identically distributed" implies that an element in the sequence is independent of the random variables that came before it. In this way, an i.i.d. sequence is different from aMarkov sequence, where the probability distribution for thenth random variable is a function of the previous random variable in the sequence (for a first-order Markov sequence). An i.i.d. sequence does not imply the probabilities for all elements of thesample space or event space must be the same.[5] For example, repeated throws of loaded dice will produce a sequence that is i.i.d., despite the outcomes being biased.
Insignal processing andimage processing, the notion of transformation to i.i.d. implies two specifications, the "i.d." part and the "i." part:
i.d. – The signal level must be balanced on the time axis.
i. – The signal spectrum must be flattened, i.e. transformed by filtering (such asdeconvolution) to awhite noise signal (i.e. a signal where all frequencies are equally present).
Suppose that the random variables and are defined to assume values in. Let and be thecumulative distribution functions of and, respectively, and denote theirjoint cumulative distribution function by.
Two random variables and areindependent if and only if for all. (For the simpler case of events, two events and are independent if and only if, see alsoIndependence (probability theory) § Two random variables.)
Two random variables and areidentically distributed if and only if for all.[6]
Two random variables and arei.i.d. if they are independentand identically distributed, i.e. if and only if
The definition extends naturally to more than two random variables. We say that random variables arei.i.d. if they are independent (see furtherIndependence (probability theory) § More than two random variables)and identically distributed, i.e. if and only if
where denotes the joint cumulative distribution function of.
A sequence of outcomes of spins of a fair or unfairroulette wheel isi.i.d. One implication of this is that if the roulette ball lands on "red", for example, 20 times in a row, the next spin is no more or less likely to be "black" than on any other spin (see thegambler's fallacy).
Toss a coin 10 times and write down the results into variables.
Such a sequence of i.i.d. variables is also called aBernoulli process.
Roll a die 10 times and save the results into variables.
Choose a card from a standard deck of cards containing 52 cards, then place the card back in the deck. Repeat this 52 times. Observe when a king appears.
Many results that were first proven under the assumption that the random variables arei.i.d. have been shown to be true even under a weakerdistributional assumption.
The most general notion which shares the main properties of i.i.d. variables areexchangeable random variables, introduced byBruno de Finetti.[citation needed] Exchangeability means that while variables may not be independent, future ones behave like past ones — formally, any value of a finite sequence is as likely as anypermutation of those values — thejoint probability distribution is invariant under thesymmetric group.
This provides a useful generalization — for example,sampling without replacement is not independent, but is exchangeable.
Instochastic calculus, i.i.d. variables are thought of as adiscrete timeLévy process: each variable gives how much one changes from one time to another. For example, a sequence of Bernoulli trials is interpreted as theBernoulli process.
This could be generalized to include continuous timeLévy processes, and many Lévy processes can be seen as limits of i.i.d. variables—for instance, theWiener process is the limit of the Bernoulli process.
Machine learning (ML) involves learning statistical relationships within data. To train ML models effectively, it is crucial to use data that is broadly generalizable. If thetraining data is insufficiently representative of the task, the model's performance on new, unseen data may be poor.
The i.i.d. hypothesis allows for a significant reduction in the number of individual cases required in the training sample, simplifying optimization calculations. In optimization problems, the assumption of independent and identical distribution simplifies the calculation of the likelihood function.Due to this assumption, the likelihood function can be expressed as:
To maximize the probability of the observed event, the log function is applied to maximize the parameter. Specifically, it computes:
where
Computers are very efficient at performing multiple additions, but not as efficient at performing multiplications. This simplification enhances computational efficiency. The log transformation, in the process of maximizing, converts many exponential functions into linear functions.
There are two main reasons why this hypothesis is practically useful with thecentral limit theorem (CLT):