Goodness of fit test for a transition density function of a Markov process Suppose that you have one realization $x = \{x_n\}_{n = 1}^{N}$ of the stochastic process $X = \{X_n\}_{n = 1}^{N}$ with state space $\mathbb{R}$. Assume that the process is Markovian, time-inhomogeneous, and has transition density function (t.d.f.) given by
$$
f(n_1, y_1, n_2, y_2) = \partial_{y_2}\mathbb{P}(X_{n_2} \leq y_2 | X_{n_1} = y_1),\quad n_1 < n_2 \leq N,\ y_1, y_2 \in \mathbb{R}.
$$
The problem is to design a method to assess the goodness of fit of $f$ as the t.d.f. of $X$.
My take: Assuming that the hypothesis
$$
\mathbb{H}_0: X \text{ is Markovian with t.d.f. given by } f,
$$
is true, then we can compute the quantile processes $\{X_n^{(q)}\}_{n=2}^{N}$, defined such that
$$
\mathbb{P}(X_{n} \leq X_n^{(q)} | X_{n-1} = x_{n-1}) = q,
$$
for $q = 0.025, 0.975$, and then check whether or not the events
$$
\{X_{n}^{(0.025)} \leq x_n \leq X_{n}^{(0.975)}\ |\ X_{n-1} = x_{n-1}\}
$$
occur for each $n = 2,\dots, N$. If the condition is not met by "too many" values of $n$, then $f$ should not be a suitable t.d.f. However, I don't know how to decide how many is "too many".
Can you think of better goodness of fit tests or give me your thoughts about my approach? I would sincerely appreciate it. Thanks.

Great question!
Here is my answer:
Define the events
$$
A_n = \{X_n^{(0.025)} \leq X_n \leq X_n^{(0.975)}\ |\ X_{n-1} = x_{n-1}\}.
$$
Under $\mathbb{H}_0$, $\{A_n\}_{n = 2}^N$ is a collection of independent events such that $\mathbb{P}(A_n) = 0.95$ for all $n=1,\dots,N$. Then, the random variable $B(X)$ that indicates how many events $A_n$ did not occur has a Bernoulli distribution with probability $0.05$ and size $N-1$. Hence, $\mathbb{H}_0$ would get rejected whenever
$$
p\text{-value} = \mathbb{P}(B(X) \geq B(x)) \leq 0.05.
$$
Such a test has a significance level of $0.05$. To change the significance level one would only have to change the quantile levels in the definition of $A_n$.
