Skip to content

Commit 000f14c

Browse files
committed
Clean up README
1 parent 4113ba7 commit 000f14c

File tree

3 files changed

+75
-87
lines changed

3 files changed

+75
-87
lines changed

README.Rmd

+24-24
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,29 @@ install.packages('PointedSDMs')
4242

4343
*PointedSDMs* includes a selection of functions used to streamline the construction of ISDMs as well and perform model cross-validation. The core functions of the package are:
4444

45-
| Function name | Function description |
46-
|------------------|------------------------------------------------------|
47-
| `startISDM()` | Initialize and specify the components used in the integrated model. |
48-
| `startSpecies()` | Initialize and specify the components used in the multi-species integrated model. |
49-
| `blockedCV()` | Perform spatial blocked cross-validation. |
50-
| `fitISDM()` | Estimate and preform inference on the integrated model. |
51-
| `datasetOut()` | Perform dataset-out cross-validation, which calculates the impact individual datasets have on the full model. |
45+
| Function name | Function description |
46+
|-------------------|-----------------------------------------------------|
47+
| `startISDM()` | Initialize and specify the components used in the integrated model. |
48+
| `startSpecies()` | Initialize and specify the components used in the multi-species integrated model. |
49+
| `blockedCV()` | Perform spatial blocked cross-validation. |
50+
| `fitISDM()` | Estimate and preform inference on the integrated model. |
51+
| `datasetOut()` | Perform dataset-out cross-validation, which calculates the impact individual datasets have on the full model. |
5252

5353
The function `intModel()` produces an [R6](https://github.com/r-lib/R6) object, and as a result there are various *slot functions* available to further specify the components of the model. These *slot functions* include:
5454

55-
| `intModel()` slot function | Function description |
56-
|-------------------|-----------------------------------------------------|
57-
| `` `.$help()` `` | Show documentation for each of the slot functions. |
58-
| `` `.$plot()` `` | Used to create a plot of the available data. The output of this function is an object of class [`gg`](https://github.com/tidyverse/ggplot2). |
59-
| `` `.$addBias()` `` | Add an additional spatial field to a dataset to account for sampling bias in unstructured datasets. |
60-
| `` `.$updateFormula()` `` | Used to update a formula for a process. The idea is to start specify the full model with `startISDM()`, and then thin components per dataset with this function. |
61-
| `` `.$updateComponents()` `` | Change or add new components used by [inlabru](https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.13168) in the integrated model. |
62-
| `` `.$priorsFixed()` `` | Change the specification of the prior distribution for the fixed effects in the model. |
63-
| `` `.$specifySpatial()` `` | Specify the spatial field in the model using penalizing complexity (PC) priors. |
64-
| `` `.$spatialBlock()` `` | Used to specify how the points are spatially blocked. Spatial cross-validation is subsequently performed using `blockedCV()`. |
65-
| `` `.$addSamplers()` `` | Function to add an integration domain for the PO datasets. |
66-
| `` `.$specifyRandom()` `` | Specify the priors for the random effects in the model. |
67-
| `` `.$changeLink()` `` | Change the link function of a process. |
55+
| `intModel()` slot function | Function description |
56+
|--------------------|----------------------------------------------------|
57+
| `` `.$help()` `` | Show documentation for each of the slot functions. |
58+
| `` `.$plot()` `` | Used to create a plot of the available data. The output of this function is an object of class [`gg`](https://github.com/tidyverse/ggplot2). |
59+
| `` `.$addBias()` `` | Add an additional spatial field to a dataset to account for sampling bias in unstructured datasets. |
60+
| `` `.$updateFormula()` `` | Used to update a formula for a process. The idea is to start specify the full model with `startISDM()`, and then thin components per dataset with this function. |
61+
| `` `.$updateComponents()` `` | Change or add new components used by [inlabru](https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.13168) in the integrated model. |
62+
| `` `.$priorsFixed()` `` | Change the specification of the prior distribution for the fixed effects in the model. |
63+
| `` `.$specifySpatial()` `` | Specify the spatial field in the model using penalizing complexity (PC) priors. |
64+
| `` `.$spatialBlock()` `` | Used to specify how the points are spatially blocked. Spatial cross-validation is subsequently performed using `blockedCV()`. |
65+
| `` `.$addSamplers()` `` | Function to add an integration domain for the PO datasets. |
66+
| `` `.$specifyRandom()` `` | Specify the priors for the random effects in the model. |
67+
| `` `.$changeLink()` `` | Change the link function of a process. |
6868

6969
## Example
7070

@@ -130,7 +130,7 @@ To improve stability, we specify priors for the intercepts of the model using ``
130130
131131
model$priorsFixed(Effect = 'Intercept',
132132
mean.linear = 0,
133-
prec.linear = 0.11)
133+
prec.linear = 1)
134134
135135
```
136136

@@ -139,7 +139,7 @@ And *PC* priors for the spatial field using `` `.$specifySpatial()` ``:
139139
```{r specifySpatial}
140140
141141
model$specifySpatial(sharedSpatial = TRUE,
142-
prior.range = c(50, 0.1),
142+
prior.range = c(0.2, 0.1),
143143
prior.sigma = c(0.1, 0.1))
144144
145145
```
@@ -148,8 +148,8 @@ We can then estimate the parameters in the model using the `fitISDM()` function:
148148

149149
```{r fitISDM, warning = FALSE, message = FALSE}
150150
151-
modelRun <- fitISDM(model, options = list(control.inla = list(int.strategy = 'eb',
152-
diagonal = 0.1),
151+
modelRun <- fitISDM(model, options = list(control.inla =
152+
list(int.strategy = 'eb'),
153153
safe = TRUE))
154154
summary(modelRun)
155155

README.md

+51-63
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,32 @@ install.packages('PointedSDMs')
4242
construction of ISDMs as well and perform model cross-validation. The
4343
core functions of the package are:
4444

45-
| Function name | Function description |
46-
|------------------|---------------------------------------------------------------------------------------------------------------|
47-
| `startISDM()` | Initialize and specify the components used in the integrated model. |
48-
| `startSpecies()` | Initialize and specify the components used in the multi-species integrated model. |
49-
| `blockedCV()` | Perform spatial blocked cross-validation. |
50-
| `fitISDM()` | Estimate and preform inference on the integrated model. |
51-
| `datasetOut()` | Perform dataset-out cross-validation, which calculates the impact individual datasets have on the full model. |
45+
| Function name | Function description |
46+
|----|----|
47+
| `startISDM()` | Initialize and specify the components used in the integrated model. |
48+
| `startSpecies()` | Initialize and specify the components used in the multi-species integrated model. |
49+
| `blockedCV()` | Perform spatial blocked cross-validation. |
50+
| `fitISDM()` | Estimate and preform inference on the integrated model. |
51+
| `datasetOut()` | Perform dataset-out cross-validation, which calculates the impact individual datasets have on the full model. |
5252

5353
The function `intModel()` produces an [R6](https://github.com/r-lib/R6)
5454
object, and as a result there are various *slot functions* available to
5555
further specify the components of the model. These *slot functions*
5656
include:
5757

58-
| `intModel()` slot function | Function description |
59-
|------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
60-
| `` `.$help()` `` | Show documentation for each of the slot functions. |
61-
| `` `.$plot()` `` | Used to create a plot of the available data. The output of this function is an object of class [`gg`](https://github.com/tidyverse/ggplot2). |
62-
| `` `.$addBias()` `` | Add an additional spatial field to a dataset to account for sampling bias in unstructured datasets. |
63-
| `` `.$updateFormula()` `` | Used to update a formula for a process. The idea is to start specify the full model with `startISDM()`, and then thin components per dataset with this function. |
64-
| `` `.$updateComponents()` `` | Change or add new components used by [inlabru](https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.13168) in the integrated model. |
65-
| `` `.$priorsFixed()` `` | Change the specification of the prior distribution for the fixed effects in the model. |
66-
| `` `.$specifySpatial()` `` | Specify the spatial field in the model using penalizing complexity (PC) priors. |
67-
| `` `.$spatialBlock()` `` | Used to specify how the points are spatially blocked. Spatial cross-validation is subsequently performed using `blockedCV()`. |
68-
| `` `.$addSamplers()` `` | Function to add an integration domain for the PO datasets. |
69-
| `` `.$specifyRandom()` `` | Specify the priors for the random effects in the model. |
70-
| `` `.$changeLink()` `` | Change the link function of a process. |
58+
| `intModel()` slot function | Function description |
59+
|----|----|
60+
| `` `.$help()` `` | Show documentation for each of the slot functions. |
61+
| `` `.$plot()` `` | Used to create a plot of the available data. The output of this function is an object of class [`gg`](https://github.com/tidyverse/ggplot2). |
62+
| `` `.$addBias()` `` | Add an additional spatial field to a dataset to account for sampling bias in unstructured datasets. |
63+
| `` `.$updateFormula()` `` | Used to update a formula for a process. The idea is to start specify the full model with `startISDM()`, and then thin components per dataset with this function. |
64+
| `` `.$updateComponents()` `` | Change or add new components used by [inlabru](https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.13168) in the integrated model. |
65+
| `` `.$priorsFixed()` `` | Change the specification of the prior distribution for the fixed effects in the model. |
66+
| `` `.$specifySpatial()` `` | Specify the spatial field in the model using penalizing complexity (PC) priors. |
67+
| `` `.$spatialBlock()` `` | Used to specify how the points are spatially blocked. Spatial cross-validation is subsequently performed using `blockedCV()`. |
68+
| `` `.$addSamplers()` `` | Function to add an integration domain for the PO datasets. |
69+
| `` `.$specifyRandom()` `` | Specify the priors for the random effects in the model. |
70+
| `` `.$changeLink()` `` | Change the link function of a process. |
7171

7272
## Example
7373

@@ -131,15 +131,15 @@ using `` `.$priorsFixed()` ``
131131

132132
model$priorsFixed(Effect = 'Intercept',
133133
mean.linear = 0,
134-
prec.linear = 0.11)
134+
prec.linear = 1)
135135
```
136136

137137
And *PC* priors for the spatial field using `` `.$specifySpatial()` ``:
138138

139139
``` r
140140

141141
model$specifySpatial(sharedSpatial = TRUE,
142-
prior.range = c(50, 0.1),
142+
prior.range = c(0.2, 0.1),
143143
prior.sigma = c(0.1, 0.1))
144144
```
145145

@@ -148,42 +148,30 @@ function:
148148

149149
``` r
150150

151-
modelRun <- fitISDM(model, options = list(control.inla = list(int.strategy = 'eb',
152-
diagonal = 0.1),
151+
modelRun <- fitISDM(model, options = list(control.inla =
152+
list(int.strategy = 'eb'),
153153
safe = TRUE))
154154
summary(modelRun)
155-
#> inlabru version: 2.10.1
156-
#> INLA version: 24.03.20
157-
#> Components:
158-
#> eBird_spatial: main = spde(geometry), group = exchangeable(1L), replicate = iid(1L)
159-
#> Parks_spatial(=eBird_spatial): main = unknown(geometry), group = exchangeable(1L), replicate = iid(1L)
160-
#> Gbif_spatial(=eBird_spatial): main = unknown(geometry), group = exchangeable(1L), replicate = iid(1L)
161-
#> Forest: main = linear(Forest), group = exchangeable(1L), replicate = iid(1L)
162-
#> NPP: main = linear(NPP), group = exchangeable(1L), replicate = iid(1L)
163-
#> Altitude: main = linear(Altitude), group = exchangeable(1L), replicate = iid(1L)
164-
#> eBird_intercept: main = linear(1), group = exchangeable(1L), replicate = iid(1L)
165-
#> Parks_intercept: main = linear(1), group = exchangeable(1L), replicate = iid(1L)
166-
#> Gbif_intercept: main = linear(1), group = exchangeable(1L), replicate = iid(1L)
167-
#> Likelihoods:
168-
#> Family: 'cp'
169-
#> Data class: 'sf', 'data.frame'
170-
#> Predictor: geometry ~ .
171-
#> Family: 'binomial'
172-
#> Data class: 'sf', 'data.frame'
173-
#> Predictor: Present ~ .
174-
#> Family: 'cp'
175-
#> Data class: 'sf', 'data.frame'
176-
#> Predictor: geometry ~ .
155+
#> Summary of 'modISDM' object:
156+
#>
157+
#> inlabru version: 2.12.0
158+
#> INLA version: 24.06.27
159+
#>
160+
#> Types of data modelled:
161+
#>
162+
#> eBird Present only
163+
#> Parks Present absence
164+
#> Gbif Present only
177165
#> Time used:
178-
#> Pre = 2.41, Running = 17.7, Post = 0.319, Total = 20.5
166+
#> Pre = 1.16, Running = 21.3, Post = 0.274, Total = 22.7
179167
#> Fixed effects:
180168
#> mean sd 0.025quant 0.5quant 0.975quant mode kld
181-
#> Forest 0.027 0.004 0.019 0.027 0.034 0.027 0
169+
#> Forest 0.054 0.006 0.042 0.054 0.066 0.054 0
182170
#> NPP 0.000 0.000 0.000 0.000 0.000 0.000 0
183-
#> Altitude -0.001 0.000 -0.001 -0.001 0.000 -0.001 0
184-
#> eBird_intercept -6.857 0.283 -7.412 -6.857 -6.301 -6.857 0
185-
#> Parks_intercept -6.089 0.401 -6.875 -6.089 -5.302 -6.089 0
186-
#> Gbif_intercept -7.415 0.317 -8.037 -7.415 -6.793 -7.415 0
171+
#> Altitude -0.002 0.001 -0.003 -0.002 -0.001 -0.002 0
172+
#> eBird_intercept -5.419 0.435 -6.271 -5.419 -4.567 -5.419 0
173+
#> Parks_intercept -4.783 0.485 -5.734 -4.783 -3.832 -4.783 0
174+
#> Gbif_intercept -6.128 0.412 -6.936 -6.128 -5.320 -6.128 0
187175
#>
188176
#> Random effects:
189177
#> Name Model
@@ -192,20 +180,20 @@ summary(modelRun)
192180
#> Gbif_spatial Copy
193181
#>
194182
#> Model hyperparameters:
195-
#> mean sd 0.025quant 0.5quant 0.975quant mode
196-
#> Range for eBird_spatial 2.915 0.278 2.417 2.898 3.511 2.858
197-
#> Stdev for eBird_spatial 0.923 0.058 0.814 0.921 1.042 0.918
198-
#> Beta for Parks_spatial 0.020 0.062 -0.103 0.021 0.141 0.023
199-
#> Beta for Gbif_spatial 0.441 0.054 0.335 0.440 0.549 0.438
183+
#> mean sd 0.025quant 0.5quant 0.975quant mode
184+
#> Range for eBird_spatial 3.615 0.912 2.460 3.421 5.946 2.92
185+
#> Stdev for eBird_spatial 2.514 0.427 1.924 2.438 3.567 2.21
186+
#> Beta for Parks_spatial 0.137 0.100 -0.043 0.133 0.348 0.11
187+
#> Beta for Gbif_spatial 0.714 0.067 0.585 0.713 0.848 0.71
200188
#>
201-
#> Deviance Information Criterion (DIC) ...............: -650.55
202-
#> Deviance Information Criterion (DIC, saturated) ....: NA
203-
#> Effective number of parameters .....................: -1472.94
189+
#> Deviance Information Criterion (DIC) ...............: 259.79
190+
#> Deviance Information Criterion (DIC, saturated) ....: 253.61
191+
#> Effective number of parameters .....................: -840.82
204192
#>
205-
#> Watanabe-Akaike information criterion (WAIC) ...: 1580.61
206-
#> Effective number of parameters .................: 331.43
193+
#> Watanabe-Akaike information criterion (WAIC) ...: 2441.50
194+
#> Effective number of parameters .................: 686.08
207195
#>
208-
#> Marginal log-Likelihood: -1607.03
196+
#> Marginal log-Likelihood: -1330.87
209197
#> is computed
210198
#> Posterior summaries for the linear predictor and the fitted values are computed
211199
#> (Posterior marginals needs also 'control.compute=list(return.marginals.predictor=TRUE)')
3.09 KB
Loading

0 commit comments

Comments
 (0)