# Maximum Likelihood Estimation IID Samples

According to these notes from Penn State on MLE and notes from Stanford CS229 on logistic regression, training data is assumed to be IID.

The Penn State notes say "...which implies by definition that the X are independent." and the Stanford notes state that "Assuming that the m training examples were generated independently, we can then write down the likelihood of the parameters as..." However, according to this Cross Validated answer the observations do not need to be IID.

Isn't X a random variable and in order to take the product for the joint probability, don't the observations need to be independent? Also is there a difference in saying that the labels (y's) are independent versus the observations (x's) are independent?

Could someone explain? What am I misunderstanding?

• They may be referring to autocorrelation, where $y_i$ values could be dependent on previous values, like $y_{i-1}$, such that $y_i = f(y_{i-1}) + \alpha + \beta x_i + \epsilon$. – ERT Jul 6 '18 at 23:44
• Look at the examples of the joint likelihood functions for dependent data in the answers to the linked CV post. They're not the product of identical likelihood functions for individual observations. – Scortchi Jul 7 '18 at 7:21