initialize_classic | R Documentation |
Generate a matrix of initial starting locations, possibly accounting for habitat mask.
initialize_classic(y, M, X, ext, site, hab_mask = FALSE, all_random = FALSE)
y |
Either a matrix or array of encounter history data, possibly
from |
M |
An integer of the total augmented population size (i.e., detected and augmented individuals). UTMs. An array is used when traps are clustered over a survey area. |
X |
Either a matrix or array representing the coordinates of traps in UTMs. An array is used when traps are clustered over a survey area. |
ext |
An |
site |
Either |
hab_mask |
Either |
all_random |
Logical. If |
This function generates initial activity center locations based on encounter histories, augmented population size, state-space buffer, and potentially a habitat mask. Note that mean trap detection locations are used for detected individuals while intial values are randomly drawn for augemented individuals. Also, a habitat check will be conducted for all locations when a habitat mask is included.
A matrix of initial activity center coordinates with M
rows
and 2 columns.
Daniel Eacker
# simulate a single trap array with random positional noise x <- seq(-800, 800, length.out = 5) y <- seq(-800, 800, length.out = 5) traps <- as.matrix(expand.grid(x = x, y = y)) # add some random noise to locations traps <- traps + runif(prod(dim(traps)),-20,20) mysigma = 300 # simulate sigma of 300 m mycrs = 32608 # EPSG for WGS 84 / UTM zone 8N # Create grid and extent Grid = grid_classic(X = traps, crs_ = mycrs, buff = 3*mysigma, res = 100) # simulate SCR data data3d = sim_classic(X = traps, ext = Grid$ext, crs_ = mycrs, sigma_ = mysigma, prop_sex = 1, N = 200, K = 4, base_encounter = 0.25, enc_dist = "binomial", hab_mask = FALSE, setSeed = 50) # generate initial activity center coordinates for 2D trap array without # habitat mask s.st3d = initialize_classic(y=data3d$y, M=500, X=traps, ext = Grid$ext, hab_mask = FALSE, all_random = FALSE) # make simple plot par(mfrow=c(1,1)) plot(Grid$grid, pch=20,ylab="Northing",xlab="Easting") points(traps, col="blue",pch=20) points(s.st3d, col="red",pch=20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.