Dear Members,
I have two estimated transition matrices and I want to compare them.
In fact I want to check the hypothesis if they come from the same process.
I tried to look for some test but all I found was independence test of
contingency tables.
The following code shows that the usual chi-squared test statistic does
not follow chisq distribution.
MCRepl <- 5000
khi12 <- rep(0,MCRepl)
for (i in 1:MCRepl){
n <- 10000
M1 <- matrix(table(sample(1:9, size = n, replace = TRUE)),3,3)
M1 <- M1/rowSums(M1)
M2 <- matrix(table(sample(1:9, size = n, replace = TRUE)),3,3)
M2 <- M2/rowSums(M2)
khi12[i] <- sum((M1-M2)^2/M2)
}
plot(density(khi12))
Is there a procedure implemented in R to make this comparison? If not,
what could be a nice test statistic?
Thank you so much,
Daniel
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.