R/RcppExports.R

Defines functions C_calc_movebeta C_calc_movealpha C_calc_beta C_calc_alpha C_calc_pr_capture C_calc_move_pdet C_calc_move_llk C_calc_pdet C_calc_llk C_calc_D

Documented in C_calc_D C_calc_llk C_calc_move_llk C_calc_move_pdet C_calc_pdet C_calc_pr_capture

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Computes mean density for each occasion
#'
#' @param D density parameter 
#' @param J total number of occasions
#' @param pr0 initial distribution over life states
#' @param tpms list of transition probability matrices (one per occasion)
#'
#' @return  vector with j^th entry the mean density on occasion j 
#'
C_calc_D <- function(D, J, pr0, tpms) {
    .Call(`_openpopscr_C_calc_D`, D, J, pr0, tpms)
}

#' Computes log-likelihood 
#'
#' @param n number of individuals 
#' @param J total number of occasions 
#' @param M total number of mesh points
#' @param pr0 initial distribution over life states
#' @param pr_capture output of calc_pr_capture() in JsModel
#' @param tpms output of calc_tpms() in JsModel
#' @param num_states 2 = CJS model, 3 = JS model 
#' @param entry vector of entry occasions per individual 
#'
#' @return log-likelihood value 
#' 
C_calc_llk <- function(n, J, M, pr0, pr_capture, tpms, num_states, entry) {
    .Call(`_openpopscr_C_calc_llk`, n, J, M, pr0, pr_capture, tpms, num_states, entry)
}

#' Computes detection probability (seen at least once)  
#'
#' @param J total number of occasions 
#' @param pr0 initial distribution over life states
#' @param pr_captures list of empty capture histories, see calc_pdet() in JsModel
#' @param tpms output of calc_tpms() in JsModel
#' @param num_states number of life states 
#'
#' @return pdet = probability seen at some time on the survey 
#' 
C_calc_pdet <- function(J, pr0, pr_captures, tpms, num_states) {
    .Call(`_openpopscr_C_calc_pdet`, J, pr0, pr_captures, tpms, num_states)
}

#' Computes log-likelihood 
#'
#' @param n number of individuals 
#' @param J total number of occasions 
#' @param pr0 initial distribution over life states
#' @param pr_capture output of calc_pr_capture() in JsModel
#' @param tpms output of calc_tpms() in JsModel
#' @param num_cells number of cells in x,y,total 
#' @param inside 0 if meshpt outside survey region, 1 otherwise 
#' @param dx mesh spacing 
#' @param dt time between occasions 
#' @param sd movement parameter for each occasion 
#' @param num_states 2 = CJS model, 3 = JS model 
#' @param entry time each individual entered survey 
#'
#' @return log-likelihood value 
#' 
C_calc_move_llk <- function(n, J, pr0, pr_capture, tpms, num_cells, inside, dx, dt, sd, num_states, minstate, maxstate, entry) {
    .Call(`_openpopscr_C_calc_move_llk`, n, J, pr0, pr_capture, tpms, num_cells, inside, dx, dt, sd, num_states, minstate, maxstate, entry)
}

#' Computes detection probability (seen at least once) for Jolly-Seber model 
#'
#' @param J total number of occasions 
#' @param pr0 initial distribution over life states
#' @param pr_captures list of empty capture histories, see calc_pdet() in JsModel
#' @param tpms output of calc_tpms() in JsModel
#' @param num_cells number of cells in x,y,total 
#' @param inside 0 if meshpt outside survey region, 1 otherwise 
#' @param dx mesh spacing 
#' @param dt time between occasions 
#' @param sd movement parameter for each occasion 
#' @param num_states 2 = CJS model, 3 = JS model 
#'
#' @return pdet = probability seen at some time on the survey 
#' 
C_calc_move_pdet <- function(J, pr0, pr_captures, tpms, num_cells, inside, dx, dt, sd, num_states, minstate, maxstate) {
    .Call(`_openpopscr_C_calc_move_pdet`, J, pr0, pr_captures, tpms, num_cells, inside, dx, dt, sd, num_states, minstate, maxstate)
}

#' Computes probability of each capture record
#'
#' @param n number of individuals 
#' @param J total number of occasions 
#' @param K total number of traps ever used  
#' @param M total number of mesh points
#' @param capthist capthist array 
#' @param enc0 encounter rate array, see calc_pr_capture() in JsModel
#' @param usage matrix with J x K where (j,k) entry is usage of trap k in occasion j
#' @param num_states number of alive states 
#' @param minstate number of states before alive (Scr,Cjs = 0, JS = 1)
#' @param maxstate number of states after alive (Scr = 0, Cjs/js = 1)
#' @param detector_type 1 = count, 2 = proximity/binary, 3 = multi-catch, 4 = transect 
#' @param n_prim number of primary occasions 
#' @param S number of secondary occasions per primary occasion 
#' @param entry occasion each individual entered survey 
#'
#' @return  Array with (i,j,m) entry the probability of capture record for individual i in occasion j given activity centre at mesh point m  
#' 
C_calc_pr_capture <- function(n, J, K, M, capthist, enc0, usage, num_states, minstate, maxstate, known_state, detector_type, n_prim, S, entry, imesh, capij) {
    .Call(`_openpopscr_C_calc_pr_capture`, n, J, K, M, capthist, enc0, usage, num_states, minstate, maxstate, known_state, detector_type, n_prim, S, entry, imesh, capij)
}

#' Computes forward probabilities
#'
#' @param n number of individuals 
#' @param J total number of occasions 
#' @param M total number of mesh points
#' @param pr0 initial distribution over life states
#' @param pr_capture output of calc_pr_capture() in JsModel
#' @param tpms output of calc_tpms() in JsModel
#' @param num_states 2 = CJS model, 3 = JS model 
#' @param entry vector of entry occasions per individual 
#'
#' @return log-likelihood value 
#' 
C_calc_alpha <- function(n, J, M, pr0, pr_capture, tpms, num_states, entry) {
    .Call(`_openpopscr_C_calc_alpha`, n, J, M, pr0, pr_capture, tpms, num_states, entry)
}

#' Computes backward probabilities
#'
#' @param n number of individuals 
#' @param J total number of occasions 
#' @param M total number of mesh points
#' @param pr0 initial distribution over life states
#' @param pr_capture output of calc_pr_capture() in JsModel
#' @param tpms output of calc_tpms() in JsModel
#' @param num_states 2 = CJS model, 3 = JS model 
#' @param entry vector of entry occasions per individual 
#'
#' @return log-likelihood value 
#' 
C_calc_beta <- function(n, J, M, pr0, pr_capture, tpms, num_states, entry) {
    .Call(`_openpopscr_C_calc_beta`, n, J, M, pr0, pr_capture, tpms, num_states, entry)
}

#' Computes forward probabilities
#'
#' @param n number of individuals 
#' @param J total number of occasions 
#' @param pr0 initial distribution over life states
#' @param pr_capture output of calc_pr_capture() in JsModel
#' @param tpms output of calc_tpms() in JsModel
#' @param num_cells number of cells in x,y,total 
#' @param inside 0 if meshpt outside survey region, 1 otherwise 
#' @param dx mesh spacing 
#' @param dt time between occasions 
#' @param sd movement parameter for each occasion 
#' @param num_states 2 = CJS model, 3 = JS model 
#' @param entry time each individual entered survey 
#'
#' @return forwards probabiltiies individual x occasion x mesh x state
#' 
C_calc_movealpha <- function(n, J, pr0, pr_capture, tpms, num_cells, inside, dx, dt, sd, num_states, minstate, maxstate, entry) {
    .Call(`_openpopscr_C_calc_movealpha`, n, J, pr0, pr_capture, tpms, num_cells, inside, dx, dt, sd, num_states, minstate, maxstate, entry)
}

#' Computes backward probabilities
#'
#' @param n number of individuals 
#' @param J total number of occasions 
#' @param pr0 initial distribution over life states
#' @param pr_capture output of calc_pr_capture() in JsModel
#' @param tpms output of calc_tpms() in JsModel
#' @param num_cells number of cells in x,y,total 
#' @param inside 0 if meshpt outside survey region, 1 otherwise 
#' @param dx mesh spacing 
#' @param dt time between occasions 
#' @param sd movement parameter for each occasion 
#' @param num_states 2 = CJS model, 3 = JS model 
#' @param entry time each individual entered survey 
#'
#' @return backwards probabiltiies individual x occasion x mesh x state 
#' 
C_calc_movebeta <- function(n, J, pr0, pr_capture, tpms, num_cells, inside, dx, dt, sd, num_states, minstate, maxstate, entry) {
    .Call(`_openpopscr_C_calc_movebeta`, n, J, pr0, pr_capture, tpms, num_cells, inside, dx, dt, sd, num_states, minstate, maxstate, entry)
}
r-glennie/openpopscr documentation built on Oct. 9, 2021, 9:01 p.m.