@ Save a gauss data set @ n=500; sig=1; @ process noise variance @ rho=.8; @ autoregressive coefficient @ theta=4; @ measurement error variance @ e=sqrt(sig)*rndn(n,1); trupid=recserar(e,0,rho); obspid=trupid+sqrt(theta)*rndn(n,1); q=trupid~obspid; q=q~(q[.,1]-meanc(q[.,1]))~(q[.,2]-meanc(q[.,2]))~seqa(1,1,n); @------------------------------------------------------@ @ simulate missing data with just a few gaps @ @ q=q[1:400,.]|q[402:450,.]|q[455:465,.]|q[475:500,.]; @ @------------------------------------------------------@ @------------------------------------------------------@ @ or simulate missing data with random gaps @ @------------------------------------------------------@ missdat=round(rndu(rows(q),1)); q=selif(q,missdat .eq 1); @------------------------------------------------------@ @ plot the data @ @------------------------------------------------------@ library pgraph; graphset; xy(q[.,5],q[.,3:4]); lbl = { trupid,obspid,trudev,obsdev,days }; create f0 =pidsim with ^lbl,0,8; if f0 == -1; errorlog "Can't open output file"; end; endif; if writer(f0,q) /= rows(q); errorlog "Disk Full"; end; endif; f0 = close(f0);