Skip to content
Prev 276615 / 398506 Next

Correction in error

Hi:

In your function call, x[1, 1] = theta = 0. In the first line of the
loop, your rbinom() call works out to be
  x[2, 1] <- rbinom(x[1, 3], 1, x[1, 1])       <=> rbinom(10, 1, 0)

That likely accounts for the error message:
Error in x[t, 1] <- rbinom(x[t - 1, 3], 1, x[t - 1, 1]) :
  replacement has length zero

HTH,
Dennis

On Mon, Nov 7, 2011 at 12:10 PM, Gyanendra Pokharel
<gyanendra.pokharel at gmail.com> wrote: