View source: R/calcConnectivity.R
calcTransition | R Documentation |
Provides simple maximum-likelihood point estimate of transition probabilities
that does not include measures of uncertainty. Incorporates detection
heterogeneity where appropriate (band/ring return data), but not location
uncertainty. Shared primarily for testing; use of estTransition
is recommended instead.
calcTransition(
banded = NULL,
reencountered = NULL,
counts = NULL,
originAssignment = NULL,
targetAssignment = NULL,
originNames = NULL,
targetNames = NULL,
method = "SANN"
)
calcPsi(
banded = NULL,
reencountered = NULL,
counts = NULL,
originAssignment = NULL,
targetAssignment = NULL,
originNames = NULL,
targetNames = NULL,
method = "SANN"
)
banded |
For band return data, a vector of the number of released animals from each origin site (including those never reencountered in a target region) |
reencountered |
For band return data, a matrix with B rows and W columns. Number of animals reencountered on each target site by origin site they came from |
counts |
Migration data without target-region detection heterogeneity
(i.e., anything but band return data) can be entered one of two ways: either
here or with |
originAssignment |
Assignment of animals (not including band return
data) to origin season sites. A vector of integers (1-B) with length number
of animals tracked. Note that these data can either be entered using this
argument and |
targetAssignment |
Assignment of animals (not including band return
data) to target season sites. A vector of integers (1-W) with length number
of animals tracked. Note that these data can either be entered using this
argument and |
originNames |
Optional, but recommended to keep track. Vector of names for the origin sites. If not provided, the function will either try to get these from another input or provide default names (capital letters) |
targetNames |
Optional, but recommended to keep track. Vector of names for the target sites. If not provided, the function will either try to get these from another input or provide default names (numbers) |
method |
See |
calcTransition
returns a list with the element(s):
psi
Matrix with point estimate of transition probabilities
r
Vector containing point estimate of reencounter probabilities at each target site. Not included unless data includes band reencounters
estTransition
, optim
nOriginSites <- 4
nTargetSites <- 4
originNames <- LETTERS[1:nOriginSites]
targetNames <- 1:nTargetSites
psiTrue <- array(c(0.1, 0.2, 0.3, 0.4,
0.2, 0.3, 0.4, 0.1,
0.3, 0.4, 0.1, 0.2,
0.4, 0.1, 0.2, 0.3),
c(nOriginSites, nTargetSites),
dimnames = list(originNames, targetNames))
rowSums(psiTrue)
rTrue <- c(0.5, 0.05, 0.3, 0.6)
banded1 <- c(500, 1000, 2000, 3000)
reencountered1 <- simCMRData(psiTrue, banded1, rTrue)$reencountered
psi_r_calc_sloppy <- calcTransition(banded = banded1,
reencountered = reencountered1,
originNames = originNames,
targetNames = targetNames,
method = "BFGS")
psi_r_calc_sloppy
psi_r_calc <- calcTransition(banded = banded1,
reencountered = reencountered1,
originNames = originNames,
targetNames = targetNames,
method = "SANN")
psi_r_calc
psi_r_mcmc <- estTransition(banded = banded1, reencountered = reencountered1,
originNames = originNames,
targetNames = targetNames,
method = "MCMC",
nSamples = 45000, nBurnin = 5000, #reduced for example speed
nThin = 1, verbose = 0)
print(psi_r_mcmc)
psi_r_boot <- estTransition(banded = banded1, reencountered = reencountered1,
originNames = originNames,
targetNames = targetNames,
method = "bootstrap",
nSamples = 200) #reduced for example speed
print(psi_r_boot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.