Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STAT 525

Spring 2023

Homework 4

Feb 9

Due at 9am on Thursday, Feb 16.

1. In class, we introduced two methods to generate self-avoiding walks:  one is a naive method and the other is the one-step-look-ahead method.  Compute the probability of generating the following self-avoiding walk (starting at a xed point A and ending at B) by the naive method and by the one-step-look-ahead method, respectively. Then compute the corresponding probabilities for the two methods if the self-avoiding walk starts at a fixed point B and ends at A.

2. (Agresti, 2002) The following table classifies a sample of psychiatrists by their school of psychiatric thought and by their opinion on the origin of schizophrenia.

Implement the exact test to test the null hypothesis that psychiatrists’ school of psy- chiatric thought and their opinion on the origin of schizophrenia are independent.  The p-value for exact test is

where T0  is the observed table above, Ω is the set of 3 × 3 contingency tables with the same row sums and column sums as T0 . Here π(T) is

where nij  is the (i, j)-th entry of the table. Use sequential importance sampling to estimate the p-value and give the standard error of your estimate. Attached your code and results.

3. Use the sequential importance sampling algorithm to estimate the total number of 3 × 3 contingency tables with the same row sums and column sums as the observed table in Problem 2.  Give your estimate and the standard error of your estimate. Attach your code and result.