The website for FPBK-with-Detection
can be found at its Package Website.
The goal of FPBK-with-Detection
is to predict a population total when
Note that the estimator is called the GSPE (Geo-Spatial Population Estimator) by many biologists in Alaska and Canada. Throughout the website and package documentation, FPBK (Finite Population Block Kriging) estimator and the GSPE are used interchangeably. Both refer to the same prediction process.
You can install the FPBK-with-Detection from GitHub with:
## install.packages("devtools")
devtools::install_git("https://github.com/highamm/FPBK-with-Detection.git")
library(FPBKPack2)
The following example shows how to predict the counts on unsampled sites in a simulated data set. See the Using the GSPE R Package
vignette under "Articles" of the Package Website for a more detailed description of how to use the package.
The plot below shows that only some of the sites were sampled. In this simulated example, the counts represent moose. The remaining sites that were not sampled do not have observed moose counts. In the plot below, sites without observed counts are coloured grey.
We can also examine the first six observations of the data set with the observed counts:
knitr::kable(head(basicdf))
| X| Xcoords| Ycoords| Moose| CountPred| DetPred1| DetPred2| Stratum | Area| |----:|----------:|----------:|------:|----------:|----------:|-----------:|:--------|-----:| | 127| 0.3157895| 0.3157895| 9| 4.302138| 0.0421800| -0.7164407| Low | 2| | 76| 0.7894737| 0.1578947| 23| 1.901080| 0.9236562| 1.6464221| Low | 2| | 78| 0.8947368| 0.1578947| NA| 2.507180| 0.2561130| -0.0964677| Low | 2| | 20| 1.0000000| 0.0000000| NA| 2.521382| 0.3524129| -1.8202738| Low | 2| | 219| 0.9473684| 0.5263158| 0| 3.692670| 0.0645832| 0.8484421| Low | 2| | 48| 0.3684211| 0.1052632| NA| 3.086353| 0.4623587| -1.1950225| High | 2|
Note that any site that does not have an observed moose count has an NA
value in the Moose
column.
To predict the counts on the unobserved sites, we fit a spatial linear model (slmfit
), use finite population block kriging to predict counts on the unobserved sites from the linear model (predict
), obtain summary output (FPBKoutput
), and obtain a data set with sitewise predictions and an HTML summary report (get_reportdoc
).
slmobj <- slmfit(formula = Moose ~ Stratum,
data = basicdf,
xcoordcol = "Xcoords",
ycoordcol = "Ycoords")
predobj <- predict(object = slmobj)
outputobj <- FPBKoutput(pred_info = predobj)
pred_df <- outputobj$predvals
get_reportdoc(outputobj)
We can also incorporate imperfect detection by adding a couple of extra arguments (see Sections 2 and 3 of the Article Using the GSPE R Package
). The Article also has information on other options to the functions, such as specifying a specific region to predict, fitting separate covariance models for each stratum, etc.
Finally, the Article Using the GSPE Shiny App
gives directions on how to upload data and then use the package with a Shiny
interface.
Links to videos on how to use the Shiny
app interface are given below:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.