Why is "stationarity" assumed in time series data? A stochastic process is composed of a sequence of random variables ordered by time,
and a time series is just a realization of such a process.
The book that I'm reading says: 
"if we assume stationarity, then we can get expectation and variance from time series data".  
I don't understand this. Doesn't stationarity mean that every random variable in the stochastic process has same distribution? 
If not, every time series data comes from different distributions how they can calculate expectation and variance from them?
 A: The book you are reading is very likely referring to weak stationarity, as opposed to strict(strong) stationarity.
A time series is strictly stationary if all statistical properties remain the same under time shift. In practice, strict stationarity is too limiting of an assumption and rarely holds true. A lot of the information about the joint distribution are provided in the mean and variance. Thus we often only require weak stationarity, which implies that the mean and covariance function is independent of t (for each lag h), provided that the second moment is finite. (Note that given that second moment is finite, strict stationarity implies weak stationarity.)
A: Stationarity means that the properties of the distribution do not change with time. It is often assumed to make analyses feasible or easier.
A: A time series $(X_t)_{t=1....T}$ is strictly stationary if for all $(t_1, t_2, ... t_n)$, $t_i  \in \mathbb{Z}$, and for all $\tau \in \mathbb{Z} $ the joint distribution of $(X_{t_1}, ... X_{t_n})$ is the same as that of $(X_{t_1+\tau}, ... X_{t_n+\tau})$. Strict stationarity implies that the distribution is invariant over time, which means that all the moments (such as expectation and variance) are constant. In many applications, a time series is assumed, for statistical convenience, to be Gaussian, that is, jointly normal. This distribution is determined by its first two moments, and in this case, weak stationarity (where first two moments are time-invariant) is equal to strict stationarity. 
