# NOT RUN {
data("Loaloa")
### Variations on the model fit by Diggle et al.
### on a subset of the Loaloa data
### In each case this shows the slight differences in syntax,
### and the difference in 'typical' computation times,
### when fit using corrHLfit() or fitme().
if (spaMM.getOption("example_maxtime")>4) {
corrHLfit(cbind(npos,ntot-npos)~elev1+elev2+elev3+elev4+maxNDVI1+seNDVI
+Matern(1|longitude+latitude),HLmethod="HL(0,1)",
data=Loaloa,family=binomial(),ranFix=list(nu=0.5))
}
if (spaMM.getOption("example_maxtime")>1.6) {
fitme(cbind(npos,ntot-npos)~elev1+elev2+elev3+elev4+maxNDVI1+seNDVI
+Matern(1|longitude+latitude),method="HL(0,1)",
data=Loaloa,family=binomial(),fixed=list(nu=0.5))
}
if (spaMM.getOption("example_maxtime")>6.8) {
corrHLfit(cbind(npos,ntot-npos)~elev1+elev2+elev3+elev4+maxNDVI1+seNDVI
+Matern(1|longitude+latitude),
data=Loaloa,family=binomial(),ranFix=list(nu=0.5))
}
if (spaMM.getOption("example_maxtime")>2.9) {
fitme(cbind(npos,ntot-npos)~elev1+elev2+elev3+elev4+maxNDVI1+seNDVI
+Matern(1|longitude+latitude),
data=Loaloa,family=binomial(),fixed=list(nu=0.5),method="REML")
}
## Diggle and Ribeiro (2007) assumed (in this package notation) Nugget=2/7:
if (spaMM.getOption("example_maxtime")>7.3) {
corrHLfit(cbind(npos,ntot-npos)~elev1+elev2+elev3+elev4+maxNDVI1+seNDVI
+Matern(1|longitude+latitude),
data=Loaloa,family=binomial(),ranFix=list(nu=0.5,Nugget=2/7))
}
if (spaMM.getOption("example_maxtime")>1.9) {
fitme(cbind(npos,ntot-npos)~elev1+elev2+elev3+elev4+maxNDVI1+seNDVI
+Matern(1|longitude+latitude),method="REML",
data=Loaloa,family=binomial(),fixed=list(nu=0.5,Nugget=2/7))
}
## with nugget estimation:
if (spaMM.getOption("example_maxtime")>17) {
corrHLfit(cbind(npos,ntot-npos)~elev1+elev2+elev3+elev4+maxNDVI1+seNDVI
+Matern(1|longitude+latitude),
data=Loaloa,family=binomial(),
init.corrHLfit=list(Nugget=0.1),ranFix=list(nu=0.5))
}
if (spaMM.getOption("example_maxtime")>5.5) {
fitme(cbind(npos,ntot-npos)~elev1+elev2+elev3+elev4+maxNDVI1+seNDVI
+Matern(1|longitude+latitude),
data=Loaloa,family=binomial(),method="REML",
init=list(Nugget=0.1),fixed=list(nu=0.5))
}
# }
Run the code above in your browser using DataLab