Description Usage Arguments Details Value Examples
Calculate exceedance probabilities pr(X > threshold) from a fitted geostatistical model.
1 2 |
x |
Output from either the |
threshold |
the value which the exceedance probability is calculated with respect to. |
random |
Calculate exceedances for the random effects, rather than the predicted observations (including fixed effects). |
template |
A |
templateIdCol |
The data column in |
nuggetInPrediction |
If |
When x
is the output from lgm
, pr(Y>threshold) is calculated using
the Gaussian distribution using the Kriging mean and conditional variance. When
x
is from the glgm
function,
the marginal posteriors are numerically integrated to obtain pr(X > threshold).
Either a vector of exceedance probabilities or an object of the same class as template
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data('swissRain')
swissFit = lgm("rain", swissRain, grid=30,
boxcox=0.5,fixBoxcox=TRUE, covariates=swissAltitude)
swissExc = excProb(swissFit, 20)
mycol = c("green","yellow","orange","red")
mybreaks = c(0, 0.2, 0.8, 0.9, 1)
plot(swissBorder)
plot(swissExc, breaks=mybreaks, col=mycol,add=TRUE,legend=FALSE)
plot(swissBorder, add=TRUE)
legend("topleft",legend=mybreaks, col=c(NA,mycol))
## Not run:
swissRain$sqrtrain = sqrt(swissRain$rain)
swissFit2 = glgm(formula="sqrtrain",data=swissRain, grid=40,
covariates=swissAltitude,family="gaussian")
swissExc = excProb(swissFit2, threshold=sqrt(30))
swissExc = excProb(swissFit2$inla$marginals.random$space, 0,
template=swissFit2$raster)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.