Skip to content
Snippets Groups Projects
Commit 19728b90 authored by Michael G Chipeta's avatar Michael G Chipeta
Browse files

Updated Figure labels to remove extra '\\'

parent 87b20617
Branches
Tags
No related merge requests found
......@@ -266,7 +266,7 @@ The fourth stage is the implementation of adaptive sampling if there is need for
In this example, we generated a binomial dataset available in the package as \code{sim.data}. We generated a realisation of Gaussian process $S(x)$ on a 35 by 35 grid covering the unit square, giving a total of $n^* = 1225$ potential sampling locations. We specified $S(x)$ to have expectation $\mu$ = 0, variance $\sigma^2$ = 1 and Mat\'{e}rn correlation function (\ref{eqn:matern}), with $\phi$ = 0.15 and $\kappa$ = 1.5, and no measurement error, i.e. $\tau^2$ = 0. Binomial observations, with 8 trials at each grid point and probabilities given by the anti-logit of the simulated values of the Gaussian process, constitute the response variable $y$. For the initial sample, we use a simple inhibitory design to sample $n_0$ = 30 locations with $\delta$ = 0.04. The results are shown in \Cref{fig:simpleinhibitory}.
<<simpleinhibitory, include=TRUE, eval=TRUE, echo=TRUE, fig.height=9, fig.width=9, fig.cap="\\\\label{fig:simpleinhibitory}Simple inhibitory (discrete) design with $\\\\delta$ = 0.04 and $n_0$ = 30.", message = FALSE, fig.asp=1>>=
<<simpleinhibitory, include=TRUE, eval=TRUE, echo=TRUE, fig.height=9, fig.width=9, fig.cap="\\label{fig:simpleinhibitory} Simple inhibitory (discrete) design with $\\delta$ = 0.04 and $n_0$ = 30.", message = FALSE, fig.asp=1>>=
library("geosample")
library("viridisLite")
data(sim.data)
......@@ -322,7 +322,7 @@ model.pred <-
Several results can be summarised and visualised from the prediction results, including \textit{predictions} and \textit{exceedance probabilities} at each of the prediction locations.
<<predvis, include = TRUE, eval=TRUE, echo=TRUE, fig.height=7, fig.width=7, fig.cap = "\\\\label{fig:predvis}Spatial prediction visualisation. Spatial predictions on the LHS and exceedance probabilities $P(x; 0.45)$ = $P$($prev$ > 0.45 at location $x$) on the RHS.", fig.asp=1>>=
<<predvis, include = TRUE, eval=TRUE, echo=TRUE, fig.height=7, fig.width=7, fig.cap = "\\label{fig:predvis} Spatial prediction visualisation. Spatial predictions on the LHS and exceedance probabilities $P(x; 0.45)$ = $P$($prev$ > 0.45 at location $x$) on the RHS.", fig.asp=1>>=
par(mfrow = c(1,2))
plot(model.pred, type = "prevalence", col = viridis(256, direction = -1),
summary = "predictions", zlim = c(0, 1))
......@@ -339,7 +339,7 @@ par(mfrow = c(1,1))
To implement a \textit{minimum distance batch adaptive sampling} of 10 additional locations, using the \textit{prediction variance} selection criterion, we extract prediction variances at all potential locations. We set the minimum sampling distance to be $\delta$ = 0.1.
<<adaptivesample, include=TRUE, eval=TRUE, echo=TRUE, fig.height=9, fig.width=9, fig.cap = "\\\\label{fig:adaptivesample}Adaptive sampling design with $\\\\delta$ = 0.1 and $b = 10$, Dark blue dots ($n_0$ = 30) are the initial sampling locations. Red dots ($n_a$ = 10) are adaptive sampling locations added after analysing data from the initial design.">>=
<<adaptivesample, include=TRUE, eval=TRUE, echo=TRUE, fig.height=9, fig.width=9, fig.cap = "\\label{fig:adaptivesample} Adaptive sampling design with $\\delta$ = 0.1 and $b = 10$, Dark blue dots ($n_0$ = 30) are the initial sampling locations. Red dots ($n_a$ = 10) are adaptive sampling locations added after analysing data from the initial design.">>=
obj.1 <- as.data.frame(cbind(model.pred$grid,
c(model.pred$prevalence$standard.errors)^2))
colnames(obj.1) <- c("coord1", "coord2", "pred.var")
......@@ -373,7 +373,7 @@ We now illustrate the use of the \pkg{geosample} package to construct a survey s
The first stage in the geostatistical design was a complete enumeration of households in the study region, including their geo-location collected using Global Positioning System devices on a Samsung Galaxy Tab 3 running the Android 4.1 Jellybean operating system. We consider \textit{focal area} A of the study area and use a simple inhibitory design to sample 60 households in the initial sample. Data from these households are then analysed using the binomial logistic model (\ref{eqn:blm}), and predictive analysis is carried out to map malaria prevalence.
All potential (available) household locations are shown in \Cref{fig:majlocs}.
<<avail, include=TRUE, eval=TRUE, echo=TRUE, fig.height=9, fig.width=9,fig.cap="\\\\label{fig:majlocs}All potential household sampling locations in Majete.", fig.asp=1>>=
<<avail, include=TRUE, eval=TRUE, echo=TRUE, fig.height=9, fig.width=9,fig.cap="\\label{fig:majlocs} All potential household sampling locations in Majete.", fig.asp=1>>=
data("border")
data("majete")
plot(st_geometry(majete), pch = 19, cex = 0.5,
......@@ -384,7 +384,7 @@ plot(border, lwd = 2, add= TRUE)
@
The sampled households (black dots) are shown in \Cref{fig:majeteSI}.
<<applic1, include=TRUE, eval=TRUE, echo=TRUE, fig.height=10, fig.width=10, fig.cap="\\\\label{fig:majeteSI}Simple inhibitory (discrete) design with $\\\\delta$ = 400 meters and $n_0$ = 60 households (black dots) in Majete.", fig.asp=1>>=
<<applic1, include=TRUE, eval=TRUE, echo=TRUE, fig.height=10, fig.width=10, fig.cap="\\label{fig:majeteSI} Simple inhibitory (discrete) design with $\\delta$ = 400 meters and $n_0$ = 60 households (black dots) in Majete.", fig.asp=1>>=
set.seed(1234)
init.sample <-
discrete.inhibit.sample(obj = majete, size = 60, delta = 0.4,
......@@ -419,7 +419,7 @@ summary(model.fit, log.cov.pars = FALSE)
We now carry out spatial predictions over all unobserved households, with the model parameters fixed at the MCML estimates, and summarise the predictive distribution of prevalence at each location through its mean, standard deviation and probability that the estimated prevalence is above 15 \%. Using these results, an adaptive sample of 40 additional households is taken. The results are shown in \Cref{fig:applicadapt1}.
<<applicadapt1, include=TRUE, eval=TRUE, echo=TRUE, fig.height=10, fig.width=10, fig.cap = "\\\\label{fig:applicadapt1}Adaptive sampling design with $\\\\delta$ = 150 meters and $b = 40$, Blue dots ($n_0$ = 60) are the initial sampling households. Red dots ($n_a$ = 40) are adaptive samples added after analysing data from the initial design.", fig.asp=1>>=
<<applicadapt1, include=TRUE, eval=TRUE, echo=TRUE, fig.height=10, fig.width=10, fig.cap = "\\label{fig:applicadapt1} Adaptive sampling design with $\\delta$ = 150 meters and $b = 40$, Blue dots ($n_0$ = 60) are the initial sampling households. Red dots ($n_a$ = 40) are adaptive samples added after analysing data from the initial design.", fig.asp=1>>=
avail.locs <- majete[!(majete$geometry) %in% (mrdt$geometry),]
model.pred <-
spatial.pred.binomial.MCML(model.fit,
......@@ -473,7 +473,7 @@ summary(model.fit, log.cov.pars = FALSE)
We now carry out spatial predictions over a 5 metre by 5 metre regular grid, with model parameters fixed at the MCML estimates from the accrued data, and summarise the predictive distribution of prevalence in each grid cell through its mean, standard deviation and probability that the estimated prevalence is above 15 \%.
<<applicpred2, include=TRUE, eval=TRUE, echo=TRUE, fig.height=9, fig.width=9, fig.cap = "\\\\label{fig:applicpred2}(a) Malaria prevalence in Majete. (b) Exceedance probabilities $P(x; 0.15)$ for the predictions. $P(x; 0.15)$ = $P$($prev > 0.15$ at location $x$). (c) Standard errors of predictions.", fig.asp=1>>=
<<applicpred2, include=TRUE, eval=TRUE, echo=TRUE, fig.height=9, fig.width=9, fig.cap = "\\label{fig:applicpred2} (a) Malaria prevalence in Majete. (b) Exceedance probabilities $P(x; 0.15)$ for the predictions. $P(x; 0.15)$ = $P$($prev > 0.15$ at location $x$). (c) Standard errors of predictions.", fig.asp=1>>=
library(splancs)
pred.poly <- as_Spatial(border)@polygons[[1]]@Polygons[[1]]@coords
grid.pred <- gridpts(pred.poly, xs=0.05, ys=0.05)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment