sumplot: Summarise and Plot Ellipse Simulations

sumplotR Documentation

Summarise and Plot Ellipse Simulations

Description

A list of outputs from runEllipseSim is summarised and optionally plotted.

Usage


simsum(simlist, component = c("fit","pred"), parm = "D", trueval = 4, 
    compact = c("av.nCH", "nvalid", "RB", "RSE", "rRMSE", "COV"), dec = 3,
    maxfactor = 10)
    
simplot(simlist, component = c("fit","pred"), parm = "D", trueval = 4, 
    xval = 1:4, xlim = c(0.7, 4.3), ylim = c(-0.2, 0.2),
    legend = TRUE, pchi = c(21, 16, 22, 24), cexi = rep(1.2,4), ...) 

Arguments

simlist

list, each component an output from runEllipseSim

component

character; from which set of output should parm be summarised?

parm

character name of parameter to summarise, default density

trueval

numeric true value of parm, default 4 animals / ha

compact

character vector for summary statistics to include in output (NULL for all)

dec

integer number of decimal places in output

maxfactor

numeric; extreme estimate filter (see Details)

xval

numeric vector of values

xlim

numeric limits of x-axis

ylim

numeric limits of y-axis

legend

logical; if TRUE a legend is displayed

pchi

numeric vector for symbol to use for each component of simlist

cexi

numeric vector for symbol size to use for each component of simlist

...

other arguments passed to points

Details

For each replicate the input simlist has components “fit“ generated by extractfn and “pred“ generated by predict.secr. Argument ‘component’ chooses between these.

These functions meet the needs of Efford in prep. as shown in the package vignette, and may not be useful for novel applications.

Each component of simlist should have the same number of components (ellipse scenarios).

Estimates with absolute value greater than maxfactor * trueval are set to NA (maxfactor is ignored if NULL).

The ... argument allows a few options such as "type = 'o'", but colour (bg) is set internally to white.

Value

List of output matrices (tables) (returned invisibly by simplot).

See Also

runEllipseSim

Examples


## Not run: 

nrepl <- 20
tr <- make.grid(6,6, spacing = 50, detector = 'proximity')
simrandom <- vector('list')
simrandomBVN <- vector('list')
for (i in 1:4) {
    sigmaX <- 25/i^0.5; sigmaY <- 25*i^0.5
    details <- list(distribution = 'binomial')
    ## uniform
    simrandom[[i]] <- runEllipseSim (nrepl, sigmaX, sigmaY, buffer = 200, ncores = 2,
                                          traps = tr, g0 = 0.2, D = 4, type = 'uniform', 
                                          CL = TRUE, detectfn = 'HHN', details = details)
    ## bvn
    simrandomBVN[[i]] <- runEllipseSim (nrepl, sigmaX, sigmaY, buffer = 200, ncores = 2,
                                             traps = tr, lambda0 = 0.4, D = 4, type = 'BVN', 
                                             CL = TRUE, detectfn = 'HHN', details = details)
    message ('Completed aspect ratio ', i)
}

simplot(list(Uniform = simrandom, BVN = simrandomBVN), legend = TRUE)

simsum(list(Uniform = simrandom36.2, BVN = simrandomBVN36.2))


## End(Not run)


MurrayEfford/secrBVN documentation built on Oct. 14, 2022, 5:20 a.m.