Original Question
#Original Question SupposeSuppose we have a sequence of Bernoulli trials $X_1, X_2, \cdots X_T$ which are ordered in time and may or may not be independent. I am interested in understanding the probability of success.. The way I'm thinking about it, I have two primary options.
- Consider the trials, $X_t \stackrel{iid}{\sim} Bern(\theta)$ and estimate $\theta$.
- Treat the observations as a markov chain (does success/failure at time $t$ have an effect on probability of success at time $t+p$?
How do i determine which model is best? Or in otherwords, how do I estimate the order of the markov chain.
To test the validity of the first model, I was considering using the approach of Andrew Gelman in his Bayesian Data Analysis book, where he constructs an "empirical p-value" via simulation using the test statistic $T = \text{longest streak of successes}$. Beyond this, I am unsure how to appropriately compare the different models.
Partial Answer
It appears that the PACF (partial autocorrelation function) can be used to estimate the order of these sequences.
I generated 3 large sequences $(T=1000)$ of Bernoulli trials, under independence, first order Markov dependence and second order Markov dependence. We plot the ACF for each case.
Moreover, for the first order Markov Chain, the ACF seems to satisfy the property of an AR(1) model that $\rho_k = \rho_1^k$.
I can't seem to find any formal justification for why this works however. As I understand it, if the Bernoulli trials satisfy a $p$ order Markov property, this does not imply the chain is an $AR(p)$ process, ecause we cannot write $$X_t = \phi X_{t-1} + \epsilon_t$$ for $\epsilon_t$ iid. (If somebody can confirm or correct me on this, that would be great).
So if the $p$ order Markov process is not an $AR(p)$ process, why does this work?