Independent and identically distributed random variables
In probability theory and statistics, a collection of random variables is independent and identically distributed if each random variable has the same probability distribution as the others and all are mutually independent. IID was first defined in statistics and finds application in many fields, such as data mining and signal processing.
Introduction
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 of independent, identically distributed random data points."In other words, the terms random sample and IID are synonymous. In statistics, "random sample" is the typical terminology, but in probability, it is more common to say "IID."
- Identically distributed means that there are no overall trends — the distribution does not fluctuate and all items in the sample are taken from the same probability distribution.
- Independent means that the sample items are all independent events. In other words, they are not connected to each other in any way; knowledge of the value of one variable gives no information about the value of the other and vice versa.
Application
The i.i.d. assumption is also used in the central limit theorem, which states that the probability distribution of the sum of i.i.d. variables with finite variance approaches a normal distribution.
The i.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 a Markov sequence, where the probability distribution for the th random variable is a function of the previous random variable in the sequence. An i.i.d. sequence does not imply the probabilities for all elements of the sample space or event space must be the same. For example, repeated throws of loaded dice will produce a sequence that is i.i.d., despite the outcomes being biased.
In signal processing and image 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 to a white noise signal.
Definition
Definition for two random variables
Suppose that the random variables and are defined to assume values in. Let and be the cumulative distribution functions of and, respectively, and denote their joint cumulative distribution function by.Two random variables and are independent if and only if for all.
Two random variables and are identically distributed if and only if for all.
Two random variables and are i.i.d. if they are independent and identically distributed, i.e. if and only if
Definition for more than two random variables
The definition extends naturally to more than two random variables. We say that random variables are i.i.d. if they are independent and identically distributed, i.e. if and only ifwhere denotes the joint cumulative distribution function of.
Examples
Example 1
A sequence of outcomes of spins of a fair or unfair roulette wheel is i.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.Example 2
Toss a coin 10 times and write down the results into variables.- Independent: Each outcome will not affect the other outcome , which means the variables are independent of each other.
- Identically distributed: Regardless of whether the coin is fair or biased, as long as the same coin is used for each flip, the probability of getting heads remains consistent across all flips.
Example 3
Roll a die 10 times and save the results into variables.- Independent: Each outcome of the die roll will not affect the next one, which means the 10 variables are independent from each other.
- Identically distributed: Regardless of whether the die is fair or weighted, each roll will have the same probability of seeing each result as every other roll. In contrast, rolling 10 different dice, some of which are weighted and some of which are not, would not produce i.i.d. variables.
Example 4
- Independent: Each observation will not affect the next one, which means the 52 results are independent from each other. In contrast, if each card that is drawn is kept out of the deck, subsequent draws would be affected by it, and the observations would not be independent.
- Identically distributed: After drawing one card from it, each time the probability for a king is 4/52, which means the probability is identical each time.
Generalizations
Exchangeable random variables
The most general notion which shares the main properties of i.i.d. variables are exchangeable random variables, introduced by Bruno de Finetti. 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 any permutation of those values — the joint probability distribution is invariant under the symmetric group.This provides a useful generalization — for example, sampling without replacement is not independent, but is exchangeable.
Lévy process
In stochastic calculus, i.i.d. variables are thought of as a discrete time Lévy process: each variable gives how much one changes from one time to another. For example, a sequence of Bernoulli trials is interpreted as the Bernoulli process.This could be generalized to include continuous time Lévy processes, and many Lévy processes can be seen as limits of i.i.d. variables—for instance, the Wiener process is the limit of the Bernoulli process.
In machine learning
involves learning statistical relationships within data. To train ML models effectively, it is crucial to use data that is broadly generalizable. If the training 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 the central limit theorem :
- Even if the sample originates from a complex non-Gaussian distribution, it can be well-approximated because the CLT allows it to be simplified to a Gaussian distribution.
- The second reason is that the model's accuracy depends on the simplicity and representational power of the model unit, as well as the data quality. The simplicity of the unit makes it easy to interpret and scale, while the representational power and scalability improve model accuracy. In a deep neural network, for instance, each neuron is simple yet powerful in representation, layer by layer, capturing more complex features to enhance model accuracy.