2

I found the R functions below in Markov_chain package and I applied that code for my dataset to investigate the stationarity, order and homogeneity of Markov chain using chi-square test but when I execute the code I got a warning that Chi-squared approximation may be incorrect. Even though, R function for test Markov property is work well.

verifyMarkovProperty(z, verbose = TRUE)

Testing Markov property on given data sequence
Chi-square statistic is: 224.1998  degrees of freedom are: 125  and corresponding p-value is: 1.263105e-07 

This is work well without warning

    assessOrder(z, verbose = TRUE)

 The assessOrder test statistic is:  NaN  the Chi-Square d.f. are:  80  the p-value is:  NaN 
Warning messages:
1: In chisq.test(mat) : Chi-squared approximation may be incorrect
2: In chisq.test(mat) : Chi-squared approximation may be incorrect
3: In chisq.test(mat) : Chi-squared approximation may be incorrect
4: In chisq.test(mat) : Chi-squared approximation may be incorrect
5: In chisq.test(mat) : Chi-squared approximation may be incorrect

this warning form R code it self or where

 assessStationarity(z, 1, verbose = TRUE)

    The assessStationarity test statistic is:  17.10439  the Chi-Square d.f. are:  0  the p-value is:  0 
Warning messages:
1: In chisq.test(mat) : Chi-squared approximation may be incorrect
2: In chisq.test(mat) : Chi-squared approximation may be incorrect
3: In chisq.test(mat) : Chi-squared approximation may be incorrect
4: In chisq.test(mat) : Chi-squared approximation may be incorrect
5: In chisq.test(mat) : Chi-squared approximation may be incorrect

the same warning message

Could anyone help me to know what is the problem, please? How can we use likelihood ratio test to check the stationarity, order, and homogeneity of Markov chain in R, please? Appreciate your help

Matthieu Brucher
  • 21,634
  • 7
  • 38
  • 62
yousif
  • 23
  • 1
  • 4

0 Answers0