Abstract
Numerous research projects in many area concentrate on phenomena that develop over extended times rather than those that are only visible at particular discrete intervals in time. The mechanisms underlying these observations are frequently selected to be represented by timehomogeneous stochastic processes (Markov model). To evaluate the suitability of these models, we process two test statistics. The first test evaluates the overall quality of fit, and the second test evaluates regional departures from homogeneity in the temporal direction. Information on the spread of two Kidney diseases is examined prior to death for 40 kidney disease patients in Rizgari Hospital during the period (20202022) . The results of both tests were significant. The statistical social science state SPSS has been used for this study.
Highlights
The transitions from the nonambulatory state to the ambulatory state generally occur after a relatively long period of time less than or equal to 43 weeks with standard error (14.5), while the transitions from the ambulatory state back to the nonambulatory state generally happen after a relatively short period of time less than or equal to 25 weeks with standard error (1.1).
Even though the goodnessoffit statistic for 8 weeks, ᵡ2 = 29.04 with degree of freedom equal to 12, provides evidence against this timehomogeneous model specification, only observations up to 50 weeks were used in computing the test due to the dearth of data in the remaining weeks. In actuality, the changes from state 2 to state 1 are seen more frequently during the 12week exams than throughout the subsequent exams. T = 1.189 is the result of the equation (14) that was used to determine whether the rate of change from state 2 to state 1 varies with time. It's possible that this is both a sign of true time dependency and the result of some heterogeneity in the individual transition rates.
The calculated parameter values are shown in Table 3. The transition rates between the two groups of patients show significant differences: those who could walk alone before receiving therapy often spent almost twice as long in state 2 before transitioning to state 1 and in state 1 before transitioning to death. µ10 are 9.998 and 5.734 weeks, while µ21 are 16.989 and 10.012 weeks.
However, the overall equation (8) of goodnessoffit statistic (ᵡ2 = 29.04, 12 d.f.), which was used to compute the test, provides evidence against this time homogenous specification of the model. This is because only observations up to 50 weeks were utilized because there were insufficient data for the remaining weeks to compute the test.
This example's main characteristic is that there are just a few distinct, unevenly spaced time intervals where data are available. This demonstrates how the method may be helpful if it is necessary to extrapolate structurerelated data from such observations. We advise applying other statistical models, such as the Cox regression model, survival analysis, or mortality rate to estimate the new model.
Full Text
Introduction
Let Z(t), t>=0, be a stochastic process where M=(0,1,2,3,4,…, i), i>1, is the finite set of states on which Z(t) is defined. Let zero be an absorbing state and let 1,2,3,4,…., i be transient states. State zero could represent retirement in an employment example or death in a clinical example. Suppose that a random sample (L) of realizations z_{ⱷ}(t) representing (H) independent individuals is selected, (ⱷƐL). Ideally, to infer properties of Z(t), each z_{ⱷ}(t) should be observed continuously. However, this is likely to be impossible or too expensive. Commonly, z_{ⱷ}(t) is observed at discrete times t_{1}<t_{2}<t_{3}<……<t_{n}, not necessarily identical for a time all (ⱷ), so that the transition between observations is missed and the length of time spent in the states occupied at t_{1}, t_{2,} t_{3,…., }t_{n} are not known precisely. Thus various standard nonparametric and semiparametric analyses of the data cannot be performed (Daoud et al. (2022), Aalen et al., 1980), to follow a fully parametric approach, it is necessary to specify the conditional probability of a state being occupied at time t_{j}, given the state occupied at t_{j1}, j=2,3,4,….n. these are found by solving the forward Kolmogorov equations associated with the model chosen to represent the underlying processes. For simplicity time homogenous makove model are often selected at least as a first approximation (Emily et al.,2020), Alamu et al., 2022).
Two test stats are presented to examine the adequacy of this class of models. The first assesses the overall quality goodness of fit, while the second tests local departures toward time in homogeneity. If the time intervals between adjacent observations are the same for all individuals and are constant, the adequacy of these models can be assessed by comparing the transition frequencies observed at each observation time. However, in many applications, followup occurs depending on availability, for example, at times of medical examinations or a survey interview. The tests proposed in this paper do not need fixed intervals of time between observations. The second test does not require the same periods for each individual. Hence the presented procedure is useful when the structure of basic continuous temporal processes is inferred from these data (NHS Choices 2011), Othman et al., 2011)
1Methodology:
Believe the realizations zⱷ(t), (ⱷϵL) and (t≥ 0) of the stochastic process Z(t). Denote by
(1)
The provisional probability of state (s) being engaged at time( )given that state (r) was occupied at time tj1, for j= 2, 3,..., n.
For continuous time processes,
let
(2)
denote the transition rate from state (R) to state s at time (t) (Lawless, J.F 2003), Bedford, T. and Cook, R.2009). A stochastic process defined on the state space (S) is fully specified when all p_{rs}(t) are defined. For a timehomogeneous Markov process the transition rates do not vary with time, i.e. p_{rs}(t)=µ_{rs}, say, and the conditional probabilities are functions of x_{j}= t_{j}t_{j1}, say, and not of t_{j1} or t_{j} (Cox and Miller (1965). Denote such timehomogeneous conditional probabilities by (x_{j}). For the special case S = (0, 1, 2),
(3)
(4)
(5)
Where r=1,2 and , for m , I=1,2; I m,
The parameters in the exponential function, , are the roots of the quadratic equation
(6a)
As q_{r0} (x_{j}) tends to 1 as x_{j}→∞, the process is absorbed in state (0). The extension of results to more than two transition states is straightforward (Cox and Miller Heterogeneity among the zⱷ(t) may be taken into account by defining the transition
rates (1) as functions of some explanatory variables, for example, by writing (Cox et al.,. 1984)
exp( ) (6b)
where and y_{ⱷ} is the vector of explanatory variables. If part of this individual heterogeneity is not recognised, and therefore omitted in the specification of equation (6b), the transition rates will appear to be negatively correlated with time even if the process is truly time homogeneous (Tony Lancaster and Stephen Nickell, 1980; Clayton and Cuzick, 1985).
2Markove Chain Model for tests for Departures from Time Homogeneous
2.1 Goodness of Fit
Let( )be the number of the realizations zⱷ(t), , in state (r) at time t, and let Q_{rs}(x_{j}) be the number of realisations which have had in state r at time t_{j} and in state s at t_{j+1} = t_{j}+x_{j}. For( ) and (x_{j}) to be observed all realisations zⱷ(t) must be observed at t_{j} and t_{j+1}. Assuming that a time homogeneous Markov process is suitable, the conditional predictable value of is
Denote by (xj) the maximum likelihood estimate of (x_{j}) which is obtained, as in equations (3,4 and 5), by considering all spaced by( xj) Then (xj) is efficiently estimated by
(7)
A goodnessoffit statistic for the timehomogeneous Markov specification of the process has been defined as the sum of the chisquared goodnessoffit statistics defined on each of the n1 disjoint intervals (t1, t2), (t2, t3),..., (tn1 , ),
(8)
Expression (8) would had have to obtain if all possible transitions among the states in (S) were treated as outcomes of a multinomial distribution. The limiting chisquare distribution of( ᵡ2 )is degrees of freedom equal to the number of independent cells in the multinomial distribution, namely K²(n1), minus the number of parameters in (xj). While, the transition rates were the same for all the realisations zⱷ(t), as in equations (3,4 and 5), the parameters were K² and the number of degrees of freedom is therefore K²(n2)
2.2. Inhomogeneity of time
Let µ = { }, r, s S, is the vector of transition rates specified a timehomogeneous Markov model. Departures from this model in the direction of timeinhomogeneity will imply that at least one of the elements in( µ )varies with time, where time has measured from the origin of the process. For simplicity, consider the case of just one transition rate being weakly time dependent. Let (t) be such a rate and its value at the origin of the process t = 0. Assuming that it was linear sable over the time interval of interest we can write for small( ),
(t)= + (9)
A local test for timeinhomogeneity of the transition rate from state 1 to state 2 is then equivalent to a test for = 0 in equation (9).
As before, the conditional probabilities associated with this new specification of the Markov model can be found by solving the forward Kolmogorov equations. An approximate solution is, for r, s M (see Appendix A for the explicit solutions when i=2),
(10)
where is the first derivative of with respect to & evaluated at = 0. The contribution to the likelihood function of the n observations on y (t) is
(11)
where are the states occupied by at the times . Denoting by , the contribution associated a timehomogeneous specification of the model, we find, under regularity conditions (Crowder, M. 2012), Crowder.and Sweeting, 1991),
(12)
The score function associated with the righthand side of equation (12) is
(13)
Where ⱷ is included in the notation to identify the contribution of each realization zⱷ(t). This is valid only under the assumption that equation (9) is a proper approximation for P12(t) and e is close to 0. A local test statistic for =0 in equation (9) can be defined as
(14)
where ( ) is the element of the inverse information matrix corresponding to which is computed at the maximum likelihood values (10) when =0. Thus ( is the variance of the score function statistic (13) when =0. Assuming asymptotic normality of equation (13), the test statistic has asymptotic standard normal distribution. The sign in equation (14) indicates whether decreases or increases with time (Barlow, R. and Proschan, F 1975).
Table 1 in appendix B, provides information on 40 individuals with kidney illness who received from Rizgari at the Erbil Hospital. Their capacity or inability to walk unassisted was noted before treatment started as well as at 3 months, 6 months, one year, and two years. Assume that states 0, 1, and 2 correspond to being dead, incapable of walking, and ambulant, respectively. Consequently, the information can be seen as discrete time observations of realizations produced by a time continuous process specified on three states. Also utilized for data analysis are the Statistics Package Social Sciences (spss) and easy fit. We fitted a time homogeneous Markov model with the identical transition rates (µrs) for all patients as a first approximation to this process.
Table 2 shows the maximum likelihood estimates of these parameters. As µ20 has have small compared with its standard erroras well as in absolute valuethe transitions from the ambulatory state to death were be likely to occur indirectly, via unobserved state in the nonambulatory state. A model with µ20 constrained to be equal to 0 is fitted to test this hypothesis, showing that there is no significant gain by estimating µrs ; the likelihood ratio test statistic is equal to 0.027. Noting that the reciprocal of σrs =1/ µrs , represents the expected time spent in state r before a transition to state s occurs, the estimate was values of the other parameters show the following. On average, transitions out of the nonambulatory state towards the ambulatory state occur after a fairly long spell ( = 43 weeks; standard error, 14.5), while transitions out of the ambulatory state back to the nonambulatory state occur after a fairly short spent in the nonambulatory state before death ( =25 weeks; standard error, 1.1).
Table2 :Using Markov Model by (MLE) of the time homogeneous: full and restricted specification
States 
Full Specification 
Restricted Specification 

R 
s 




1 
0 
0.173 (0.08) 
4.9 (2.1) 
0.2 (0.040) 
4.9 (1.1) 
1 
2 
0.039 (0.037) 
24.2 (22.9) 
0.041 (0.029) 
24 (17.5) 
2 
0 
0.005 (0.027) 
187.9 (1022.2) 


2 
1 
0.110 (0.021) 
10 (2.3) 
0.110 (0.019) 
8.9 (1.9) 
Maximum Likelihood 
110.2 
111.54 
Standard errors are given in parentheses: the standard error of times the standard error of
The overall equation of goodnessoffit statistic 8, however, shows evidence against this time homogeneous specification of the model, X2 = 29.04, 12 d.f.; only the observations up to 50 weeks were used in computing the test because of sparseness of data in the following weeks. Indeed, the transitions from state 2 to state 1 are observed more frequently at the 12 weeks examinations than at the following examinations. The equation (14) computed to test whether the transition rate from state 2 to state 1 changes as time increases takes a negative, although not significant, value; T = 1.189. This could be an indication of truly time dependence as well as a consequence of some heterogeneity in the individual transition rates.
To explore whether this is feasible we use information about the pretreatment status of each patient, treating it as a proxy for individual frailty (James et al., 1979). Let (z) take value 1 if the patient was in a nonambulatory status, value 0 otherwise, and
Table3: MLE of the time homogeneous Markov model with transition rates depending on y
State 


State occupied before treatment 

R 
s 


State 1 
State 2 

1 
0 
0.089 (0.019) 
0.510 (3.012 
0.180 
5.734 
0.089 
9.998 
1 
2 
0.050 (0.029) 
0.312 (1.356) 
0.028 
28.989 
0.052 
20.021 
2 
0 
0.051 (0.016) 
17.898 (2.797) 
0.000 
0.000 
0.051 
20.283 
2 
1 
0.058 (0.014 
0.621 (0.601) 
0.998 
10.012 
0.060 
16.989 
MLE 
109.97 




Table 4:Observed and fitted frequencies of transition between states: time homogenous Markov specification.
J 
ij 
Observed (0) Fitted 
ij+1 Observed (1) Fitted 
ij+1 Observed (2) Fitted 

Subset of patents in state 1 before treatment began


1 
1 2 
8 0 
4.289 0.445 
1 3 
0.765 7.497 
2 5 
5.897 2.031 
2 
1 2 
2 0 
3.198 0.199 
2 2 
0.487 3.220 
6 1 
3.889 0.101 
3 
1 2 
5 1 
3.679 0.678 
1 2 
0.469 2.287 
2 1 
1.679 1.221 
4 
1 2 
3 2 
2.369 1.297 
1 3 
0.198 1.023 
0 0 
0.301 0.698 
Subset of patents in state 2 before treatment began


1 
1 2 
0 1 
0 (2.1980) 
0 12 
0 (10.968) 
0 3 
0 (1.789) 
2 
1 2 
0 1 
0.489 (1.568) 
2 9 
0.302 (8.032) 
1 1 
2.298 (1.301) 
3 
1 2 
1 6 
0.559 (3.013) 
0 5 
0.298 (5.497) 
2 0 
1.089 (1.601) 
4 
1 2 
3 2 
0.989 2.602 
0 2 
0.298 (1.558) 
0 1 
0.669 (0.779) 
Specify a time homogeneous Markov model with transition rates depending on y as in equation (6). Table 3 reports the values of the estimated parameters. Significant differences in the transition rates of the two groups of patients surface: those who were able to walk unaided before treatment began have, on average, state spells in state 2 before a transition to state 1 and in state 1 before a transition to death, almost twice as long as the others is 16.989 weeks and 10.012 weeks and 10 is 9.998 weeks and 5.734 weeks. The overall goodness of fit of this specification is satisfactory (Table 4). The test statistic 8, soft a value of 36.32, however, should not be formally compared with a chisquared statistic distribution with 24 degrees of freedom since the data in the table are very sparse.
A key feature of this example is that data are available only at a few separate unequally spaced time points. It illustrates how the procedure may be useful whenever it is required to recover information about the structure of a continuous time process from such observations.
Appendix A:
The expressions in equation 10 are derived as follows, for M =(0,1,2), Suppose that at time t state r is occupied, Thus the Kolmogorov forward equations is for (Crowder 2012), Lemke. 2016).
(t, )=  a1
(t, )= a2
Combining equations 9 and (a1 and a2), we find
(t, )  a3
(t, ) a4
A first – order Taylor expansion of around yield
a5
r,s=1,2, where x= and (t, ) is the first derivative of with respect to evaluated at . Combining equations (a5) and (a3, a4) and equating the coefficients of we find
a6
a7
This yields solutions
a8
a9
Where are the roots of equation 6a and , for I, m =1,2, I
a10
a11
a12
a13
Combining equations (a8, a9 and a3) we have
a14
a15
Where and m =1,2, were defined in equation (3,4 and 5). Since
a16
The limiting event of the process is, once again, absorbing in state 0. Better approximation to the solution of equation a1 and a2 can be obtained by expanding equation a5 to higher orders and equating, in sequence, the coefficient of ɛ, ɛ2, ɛ3,….
Appendix B:
Table 1: Kidney Disease data from Rizgari hospital Erbil Between 202022
Patient 
Initial 
Status at following followup times (in weeks) 


status 
0 
12 
24 
48 
96 
1 
2 
2 
2 
2 
2 
0 
2 
2 
2 
2 
2 
0 

3 
1 
1 
0 



4 
1 
2 
1 
2 
2 
0 
5 
2 
2 
2 
2 
2 

6 
2 
2 
2 
2 
0 

7 
2 
2 
1 
2 
2 
2 
8 
1 
2 
1 
0 


9 
2 
2 
2 
2 
2 
0 
10 
1 
1 
0 



11 
1 
1 
0 



12 
2 
2 
2 
2 
0 

13 
1 
1 
0 



14 
1 
2 
2 
2 
0 

15 
1 
1 
0 



16 
1 
1 
0 



17 
2 
2 
2 
2 
0 

18 
1 
1 
1 
0 


19 
2 
2 
0 



20 
2 
2 
1 
1 
1 
2 
21 
1 
1 
0 



22 
1 
2 
2 
2 
2 
0 
23 
1 
1 
0 



24 
2 
2 
1 
Un.k 
0 

25 
2 
2 
2 
2 
2 
2 
26 
1 
1 
1 
1 
1 
2 
27 
1 
2 
1 
1 
1 
0 
28 
1 
2 
2 
2 
2 
0 
29 
1 
2 
1 
1 
0 

30 
1 
2 
2 
1 
0 

31 
1 
2 
1 
1 
1 
2 
32 
2 
2 
2 
1 
1 
0 
33 
1 
2 
1 
Un.k 
0 

34 
2 
2 
2 
2 
0 

35 
2 
2 
2 
0 


36 
1 
1 
0 



37 
1 
1 
0 



38 
2 
2 
0 



39 
2 
2 
2 
0 


40 
1 
1 
1 
1 
0 

State 0 ≡ death; state 1≡ nonambulant status; state 2 ≡ ambulant status; Un.k ≡ alive but unknown status.
Conclusion and Recommendation:
Typically, the Markov model is used to examine the homogeneity of time series data. Due to this, we used two statistical tests to determine whether this model was adequate. The first test evaluates the model's quality of fit, whereas the second evaluates the homogeneity of the model using maximum likelihood. Utilizing weekly patient data on patients with kidney disorders gathered from Rizgari Hospital for the years 2020 to 2022, by using social science software packages. The time continuous process must be specified in terms of three states while representing the study's data as discrete time observations. As previously mentioned, states 0 and 1 denote death and nonambulant condition; state 2 respectively. We fitted a time homogeneous Markov model with the identical transition rates µrs for all patients as a first approximation to this process.
The transitions from the nonambulatory state to the ambulatory state generally occur after a relatively long period of time less than or equal to 43 weeks with standard error (14.5), while the transitions from the ambulatory state back to the nonambulatory state generally happen after a relatively short period of time less than or equal to 25 weeks with standard error (1.1).
Even though the goodnessoffit statistic for 8 weeks, ᵡ2 = 29.04 with degree of freedom equal to 12, provides evidence against this timehomogeneous model specification, only observations up to 50 weeks were used in computing the test due to the dearth of data in the remaining weeks. In actuality, the changes from state 2 to state 1 are seen more frequently during the 12week exams than throughout the subsequent exams. T = 1.189 is the result of the equation (14) that was used to determine whether the rate of change from state 2 to state 1 varies with time. It's possible that this is both a sign of true time dependency and the result of some heterogeneity in the individual transition rates.
The calculated parameter values are shown in Table 3. The transition rates between the two groups of patients show significant differences: those who could walk alone before receiving therapy often spent almost twice as long in state 2 before transitioning to state 1 and in state 1 before transitioning to death. µ10 are 9.998 and 5.734 weeks, while µ21 are 16.989 and 10.012 weeks.
However, the overall equation (8) of goodnessoffit statistic (ᵡ2 = 29.04, 12 d.f.), which was used to compute the test, provides evidence against this time homogenous specification of the model. This is because only observations up to 50 weeks were utilized because there were insufficient data for the remaining weeks to compute the test.
This example's main characteristic is that there are just a few distinct, unevenly spaced time intervals where data are available. This demonstrates how the method may be helpful if it is necessary to extrapolate structurerelated data from such observations. We advise applying other statistical models, such as the Cox regression model, survival analysis, or mortality rate to estimate the new model.