Question: How can I fix this to satify this problem with R ? set.seed ( 0 ) n = 8 nsteps = 1 0 0 0

How can I fix this to satify this problem with R?
set.seed(0)
n=8
nsteps=1000
curr=matrix(sample(c(0,1),n^2,replace=T),n,n)
beta=2
for (step in 1:nsteps){
i=sample(1:n,1)
j=sample(1:n,1)
nsum=0
if (i>1){nsum=nsum+curr[i-1,j]}
if (i>1 & j>1){nsum=nsum+curr[i-1,j-1]}
if (i>1 & j1){nsum=nsum+curr[i+1,j-1]}
if (i1){nsum=nsum+curr[i,j-1]}
if (j

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!