Description Usage Arguments Details Value References Examples
Functions written in the pattern of the following utility.function
can be used with optimiseSSNDesign
. Off-the-shelf implementations are provided for the utility functions outlined in Falk et al. (2014) and modifications of these intended for creating adaptive designs.
1 2 | CPOptimality(ssn, glmssn, design.points, prior.parameters, n.draws,
extra.arguments)
|
ssn |
An object of class SpatialStreamNetwork |
glmssn |
A fitted model object of class glmssn. |
design.points |
A vector of pids corresponding to a set of observed sites in the obspoints slot of the SpatialStreamNetwork object. |
prior.parameters |
A list of random functions that are parameterised in terms of n.draws. |
n.draws |
A numeric scalar for the number of Monte Carlo draws to use when approximating the utility. |
extra.arguments |
A list of extra parameters that control the behaviour of the utility function. The distance matrices required to compute covariance matrices are also stored in this list. Note that these are generated inside |
The following utility functions have been implemented.
DOptimality for optimal estimation of the fixed effects when the covariance parameters are known.
EDOptimality for optimal estimation of the fixed effects when the covariance parameters are not well known and must be estimated from the data.
CPOptimality for optimal estimation of the covariance parameters.
CPDOptimality for optimal estiamtion of both the covariance parameters and fixed effects parameters.
KOptimality for maximising the accuracy of kriging predictions when the covariance parameters are known.
EKOptimality for maximising the accuracy of kriging predictions when the covariance parameters are unknown and must be estimated fomr the data.
spaceFillingMaximin for constructing space filling designs that maximise the minimum distance between any pair of points in a design.
spaceFillingMorrisMitchell for constructing space filling designs using a modified version of the maximin utility function that also accounts for larger distances between pairs of points.
sequentialDOptimality for adaptively constructing designs that allow for optimal estimation of the fixed effects parameters when the covariance parameters are known.
sequentialEDOptimality for adaptively constructing designs that allow for optimal estimation of the fixed effects parameters when the covariance parameters are unknown and must be estimated from the data.
sequentialEDOptimality for adaptively constructing designs that allow for optimal estimation of the fixed effects parameters when the covariance parameters are unknown and must be estimated from the data.
sequentialCPOptimality for adaptively constructing designs that allow for optimal estimation of the covariance parameters.
When the returned value is -1e9
, this indicates the utility function has failed to compute.
Do not worry about passing arguments to this function. All arguments are handled internally by optimiseSSNDesign
.
A single number representing the expected utility for the design specified by design.points
.
Falk, M., McGree, J.M., and Pettit, A.N. (2014). Sampling designs on stream networks using the pseudo-Bayesian approach. Environmental and Ecological Statistics, 21(4), 751-773.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
# Create stream network
s <- createSSN(100, systematicDesign(0.25),
path = paste(tempdir(), "s.ssn", sep = "/"), importToR = TRUE)
createDistMat(s)
# Simulate data on network
s <- SimulateOnSSN(s, getSSNdata.frame(s),
formula = ~1, coefficients = 1, CorParms = c(1,2,1,2,1,2,0.1),
addfunccol = "addfunccol")$ssn.object
# Fit a model to the simulated data
m <- glmssn(Sim_Values ~ 1, s, addfunccol = "addfunccol")
# Define the priors on the covariance parameters
p <- constructLogNormalCovPriors(m)
# Find the optimal design using D-optimality as the utility function
r <- optimiseSSNDesign(s, paste(tempdir(), "r.ssn", sep = "/"),
m, 25, utility.function = DOptimality, prior.parameters = p)
# Plot result to check
plot(r$ssn.new, "Sim_Values")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.