একটি মার্কভ চেইনের স্মৃতিবিহীন সম্পত্তি পরীক্ষা করুন


17

আমি সন্দেহ করি যে পর্যবেক্ষণের ক্রমগুলির একটি সিরিজ একটি মার্কভ চেইন ...

X=(ACDDBACBAACADABCADABE)

তবে আমি কীভাবে তা পরীক্ষা করে দেখতে পারি যে তারা সত্যিই পি এর স্মৃতিবিহীন সম্পত্তিকে সম্মান করে ( X i = x i | X j = x j ) ?

P(Xi=xi|Xj=xj)?

বা খুব কমপক্ষে প্রমাণ করুন যে তারা প্রকৃতির মার্কভ? নোট করুন এগুলি নিখরচায় পর্যবেক্ষণ করা হয় কোন চিন্তা?

সম্পাদনা

কেবল যোগ করার জন্য, লক্ষ্যটি পর্যবেক্ষণকৃতদের থেকে অনুক্রমের পূর্বাভাসিত সেটটিকে তুলনা করা। সুতরাং এগুলি কীভাবে তুলনা করা যায় তা সম্পর্কে আমরা মন্তব্যগুলির প্রশংসা করব।

প্রথম অর্ডার ট্রানজিশন ম্যাট্রিক্স

Mij=xijmxik
যেখানে m = A..E রয়েছে

M=(0.18340.30770.07690.14790.28400.46970.11360.00760.25000.15910.18270.24040.22120.19230.16350.23780.18180.06290.33570.18180.24580.17880.11730.17880.2793)

এম এর Eigenvalues

E=(1.0000000000.2283000000.1344000000.11360.0430i000000.1136+0.0430i)

এম এর Eigenvectors

V=(0.44720.58520.42190.23430.0421i0.2343+0.0421i0.44720.78380.42110.44790.2723i0.4479+0.2723i0.44720.20060.37250.63230.63230.44720.00100.70890.21230.0908i0.2123+0.0908i0.44720.05400.05890.2546+0.3881i0.25460.3881i)

কলামগুলিতে সিরিজ এবং সারিগুলির ক্রমগুলির উপাদান রয়েছে? সারি এবং কলামগুলির পর্যবেক্ষণ সংখ্যা কত?
এমপিটিকাস

2
সম্ভাব্য সদৃশ: stats.stackexchange.com/questions/29490/…
mpiktas

@ এমপিক্টাস সারিগুলি রাজ্য AD এর মাধ্যমে ট্রানজিশনের স্বতন্ত্র পর্যবেক্ষণ অনুক্রমের প্রতিনিধিত্ব করে। এখানে প্রায় 400 টি সিকোয়েন্স রয়েছে ... মনে রাখবেন যে পর্যায়ক্রমে পর্যালোচনাগুলি একই দৈর্ঘ্যের নয়। প্রকৃতপক্ষে অনেক ক্ষেত্রে উপরের ম্যাট্রিক্সটি জিরো দ্বারা বাড়ানো হয়েছে। যাইহোক লিঙ্কটির জন্য আপনাকে ধন্যবাদ। দেখে মনে হচ্ছে এই ক্ষেত্রে কাজ করার জন্য এখনও যথেষ্ট জায়গা আছে। আপনার কি আরও কিছু চিন্তা আছে? শুভেচ্ছা,
এইচসিএআই

1
লিনিয়ার রিগ্রেশন আমার যুক্তির বিন্দুটিকে শক্তিশালী করার একটি উদাহরণ ছিল। অর্থ্যাৎ আপনার সরাসরি মার্কভ সম্পত্তি পরীক্ষা করার দরকার নেই, আপনাকে কেবলমাত্র কয়েকটি মডেমের ফিট করতে হবে যা মার্কভের সম্পত্তি ধরে নেয় এবং তারপরে মডেলের বৈধতা পরীক্ষা করে।
এমপিটিকাস

1
আমার অস্পষ্টভাবে মনে আছে আমি কোথাও H0 = {মার্কভ} বনাম H1 = {মার্কভ অর্ডার 2 for এর জন্য একটি অনুমান পরীক্ষা দেখেছি} এটি সাহায্য করতে পারে।
স্টাফেন লরেন্ট

উত্তর:


5

আমি ভাবছি যদি নীচেগুলি একটি বৈধ পিয়ারসন χ2 অনুসারে অনুপাতের জন্য পরীক্ষা দেয়।

  1. এক-পদক্ষেপের রূপান্তর সম্ভাবনার অনুমান করুন - আপনি এটি করেছেন।
  2. প্রাপ্ত দুটি পদক্ষেপে মডেল
    p^U,V=Prob[Xi+2=U|Xi=V]=W{A,B,C,D}Prob[Xi+2=U|Xi+1=W]Prob[Xi+1=W|Xi=V]
  3. Obtain the two-step empirical probabilities
    p~U,V=i#Xi=V,Xi+2=Ui#Xi=V
  4. Form Pearson test statistic
    TV=#{Xi=V}U(p^U,Vp~U,V)2p^U,V,T=TA+TB+TC+TD

It is tempting for me to think that each TUχ32, so that the total Tχ122. However, I am not entirely sure of that, and would appreciate your thoughts on this. I am not likewise not co sertain about whether one needs to be paranoid about independence, and would want to split the sample in halves to estimate p^ and p¯.


Don't the probabilities have to have a normal distribution with mean 0 and variance=1 for this to hold? I'd be very interested to know what anyone thinks here.
HCAI

That's what the terms in the sum are supposed to be, asymptotically with large counts.
StasK

6

Markov property might be hard to test directly. But it might be enough to fit a model which assumes Markov property and then test whether the model holds. It may turn out that the fitted model is a good approximation which is useful for you in practice, and you need not to be concerned whether Markov property really holds or not.

The parallel can be drawn to the linear regression. The usual practice is not to test whether linearity holds, but whether linear model is a useful approximation.


This seems like the best option in reality, only I cannot actually compare a linear model to any actual experimental data. Or did you have something else in mind?
HCAI

6

To concretize the suggestion of the previous reply, you first want to estimate the Markov probabilities - assuming it's Markov. See the reply here Estimating Markov Chain Probabilities

You should get a 4 x 4 matrix based on the proportion of transitions from state A to A, A to B, etc. Call this matrix M. M2 should then be the two-step transition matrix: A to A in 2 steps, and so on. You can then test if your observed 2 step transition matrix is similar to M2.

Since you have a lot of data for the number of states, you could estimate M from one half of the data and test M2 using the other half - you are testing observed frequencies against theoretical probabilities of a multinomial. That should give you an idea of how far off you are.

Another possibility would be to see if the basic state proportions: proportion time spent in A, time spent in B, matches the eigenvector of the unit eigenvalue of M. If your series has reached some sort of steady state, the proportion of time in each state should tend to that limit.


There's a bit to take in there.I have calculated the Transition matrix M, but I'm not sure how you'd calculate the M2 empirically. Could you clarify that point? Regards,
HCAI

Also, the latter comment is very interesting, although I don't have the time spent in each state of my observed sequences. I only have the total time for each row. So that may limit the applicability of that method. What are your thoughts?
HCAI

1
Do it the same way you did M, only instead of looking at nearest neighbour transitions, (say, sequences AB), look at pairs that are 2 apart. So, if a subject goes ACB, that counts towards your AB transition count. So does ABB. Create a matrix where item in row i, column j contains the i to j transitions. Then divide by the column totals. You want the columns to sum to 1. Under the Markov property, this matrix should be close to M2
Placidia

RE: equilibrium. I was assuming that the transitions occur at set moments - say every second, you transition from current state to next state. You could take the frequency of A, B, C, and D states near the ends of the sequences, or across sequences to estimate the limit behaviour.
Placidia

In R, if you do eigen(M), you should get the eigenvalues and eigenvectors of M. One eigenvalue will be 1. The corresponding eigenvector should be proportional to your steady state proportions .... if Markov.
Placidia

2

Beyond Markov Property (MP), a further property is Time Homogeneity (TH): Xt can be Markov but with its transition matrix P(t) depending on time t. E.g., it may depend on the weekday at t if observations are daily, and then a dependence Xt on Xt7 conditional on Xt1 may be diagnosed if TH is unduly assumed.

Assuming TH holds, a possible check for MP is testing that Xt is independent from Xt2 conditional on Xt1, as Michael Chernick and StasK suggested. This can be done by using a test for contingency table. We can build the n contingency tables of Xt and Xt2 conditional on {Xt1=xj} for the n possible values xj, and test for independence. This can also be done using Xt with >1 in place of Xt2.

In R, contingency tables or arrays are easily produced thanks to the factor facility and the functions apply, sweep. The idea above can also be exploited graphically. Packages ggplot2 or lattice easily provide conditional plots to compare conditional distributions p(Xt|Xt1=xj,Xt2=xi). For instance setting i as row index and j as column index in trellis should under MP lead to similar distributions within a column.

The chap. 5 of the book The statistical analysis of stochastic processes in time by J.K Lindsey contains other ideas for checking assumptions.

enter image description here

[## simulates a MC with transition matrix in 'trans', starting from 'ini'
simMC <- function(trans, ini = 1, N) {
  X <- rep(NA, N)
  Pcum <- t(apply(trans, 1, cumsum))
  X[1] <- ini 
  for (t in 2:N) {
    U <- runif(1)
    X[t] <- findInterval(U, Pcum[X[t-1], ]) + 1
  }
  X
}
set.seed(1234)
## transition matrix
P <- matrix(c(0.1, 0.1, 0.1, 0.7,
              0.1, 0.1, 0.6, 0.2,
              0.1, 0.3, 0.2, 0.4,
              0.2, 0.2, 0.3, 0.3),
            nrow = 4, ncol = 4, byrow = TRUE)
N <- 2000
X <- simMC(trans = P, ini = 1, N = N)
## it is better to work with factors
X <- as.factor(X)
levels(X) <- LETTERS[1:4]
## table transitions and normalize each row
Phat <- table(X[1:(N-1)], X[2:N])
Phat <- sweep(x = Phat, MARGIN = 1, STATS = apply(Phat, 1, sum), FUN = "/")
## explicit dimnames
dimnames(Phat) <- lapply(list("X(t-1)=" ,"X(t)="),
                         paste, sep = "", levels(as.factor(X)))
## transition 3-fold contingency array
P3 <- table(X[1:(N-2)], X[2:(N-1)], X[3:N])
dimnames(P3) <- lapply(list("X(t-2)=", "X(t-1)=" ,"X(t)="),
                       paste, sep = "", levels(as.factor(X)))
## apply ONE indendence test 
fisher.test(P3[ , 1, ], simulate.p.value = TRUE)
## plot conditional distr.
library(lattice)
X3 <- data.frame(X = X[3:N], lag1X =  X[2:(N-1)], lag2X = X[1:(N-2)])
histogram( ~ X | lag1X + lag2X, data = X3, col = "SteelBlue3")

]


2

I think placida and mpiktas have both given very thoughtful and excellent approaches.

I am answering because I just want to add that one could construct a test to see if P(Xi=x|Xi1=y) is different from P(Xi=x|Xi1=y and Xi2=z).

I would pick values for x, y and z for which there are a large number of cases where the transition from z to y to x occurs. Compute sample estimates for both probabilities. Then test for difference in proportions. The difficult aspect of this is to get the variances of the two estimates under the null hypothesis that say the proportions are equal and the chain is stationary and Markov. In that case under the null hypothesis if we just look at all 2 stage transitions and compare them to their corresponding three stage transitions but only include outcomes where these sets of paired outcomes are separate by at least 2 time points then the sequence of joint outcomes where success is defined as a z to y to x transition and all other two stage transitions to x as failures represent a set of independent Bernoulli trials under the null hypothesis. The same would work for defining all y to x transitions as successes and other one stage transitions to x as failures.

Then the test statistic would be the difference between these estimated proportions. The complication to the standard comparison of the Bernoulli sequences is that they are correlated. But you could do a bootstrap test of binomial proportions in this case.

The other possibility is to construct a two by two table of the two stage and three stage paired outcomes where 0 is failure and 1 is success and the cell frequencies are counts for the pairs (0,0), (0,1), (1,0) and (1,1) where the first component is the two stage outcome and the second is the corresponding three stage outcome. You can then apply McNemar's test to the table.


I see what you are referring to here although I'm finding the first paragraph very terse however. For example "Compute sample estimates[...], then test for difference in proportions". What do you mean by sample estimates? Surely there would be no variance in
P(Xi|Xi1=y)
or am I misunderstanding your train of thought?
HCAI

@user1134241 You mentioned "empirically observed", I assumed that you have data from this stochastic sequence. If you want to estimate P(Xi=x|Xi1=y) for each index i-1 where Xi1=y, count the number of times Xi = x and divide it by the number of times Xi1 = y (regardless of what Xi equals). That is an estimate because the observed finite sequence is just a sample of a portion of a sequence of the stochastic process.
Michael R. Chernick

In your last paragraph, let me ask what constitute a success and exactly? In the case where you say a two-step transition: are you saying iji and a 3-step would be ijki?
HCAI

1

You could bin the data into evenly spaced intervals, then compute the unbiased sample variances of subsets {Xn+1:Xn=x1,Xnk=x2}. By the law of total variance,

Var[E(Xn+1|Xn,Xnk)|Xn]=Var[Xn+1|Xn]E(Var[Xn+1|Xn])

The LHS, if it is almost zero, provides evidence that the transition probabilities do not depend on Xnk, though it is clearly a weaker statement: e.g., let Xn+1N(Xn,Xn1). Taking the expected value of both sides of the above equation, the RHS can be computed from the sample variances (i.e., replacing expected values with averages). If the expected value of the variance is zero then the variance is 0 almost always.

আমাদের সাইট ব্যবহার করে, আপনি স্বীকার করেছেন যে আপনি আমাদের কুকি নীতি এবং গোপনীয়তা নীতিটি পড়েছেন এবং বুঝতে পেরেছেন ।
Licensed under cc by-sa 3.0 with attribution required.