{'fraction_non_alphanumeric': 0.03075489282385834, 'fraction_numerical': 0.016775396085740912, 'mean_word_length': 5.172413793103448, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A general goodness‐of‐fit test for Markov and hidden Markov models

Markov models are a convenient and useful method of estimating transition rates between levels of a categorical response variable, such as a disease stage, which changes over time. In medical applications the response variable is typically observed at irregular intervals. A Pearson‐type goodness‐of‐fit test for such models was proposed by Aguirre‐Hernandez and Farewell (Statist. Med. 2002; 21:1899–1911), but this test is not applicable in the common situation where the process includes an absorbing state, such as death, for which the time of entry is known precisely nor when the data include censored state observations. This paper presents a modification to the Pearson‐type test to allow for these cases. An extension of the method, to allow for the class of hidden Markov models where the response variable is subject to misclassification error, is given. The method is applied to data on cardiac allograft vasculopathy in post‐heart‐transplant patients. Copyright © 2007 John Wiley & Sons, Ltd.