Package 'pupR'

Title: Model-Based Estimation of Northern Fur Seal Pup Production
Description: Provide a set of models for estimation of northern fur seal pup production.
Authors: Devin S. Johnson
Maintainer: Devin S. Johnson <[email protected]>
License: CC0
Version: 0.0.1
Built: 2024-10-26 02:38:44 UTC
Source: https://github.com/dsjohnson/pupR

Help Index


Model-based estimation of northern fur seal pup production

Description

Mark-resight models for estimation of northern fur seal pup abundance.

Package: pupR
Type: Package
Version: 0.0.1
Date: February 27, 2017
License: CC0
LazyLoad: yes

Note

This software package is developed and maintained by scientists at the NOAA Fisheries Alaska Fisheries Science Center and should be considered a fundamental research communication. The reccomendations and conclusions presented here are those of the authors and this software should not be construed as official communication by NMFS, NOAA, or the U.S. Dept. of Commerce. In addition, reference to trade names does not imply endorsement by the National Marine Fisheries Service, NOAA. While the best efforts have been made to insure the highest quality, tools such as this are under constant development and are subject to change.

Author(s)

Devin S. Johnson

Maintainer: Devin S. Johnson <[email protected]>


Binomial PDF

Description

A binomial pdf that handles a noninteger 'size' argument.

Usage

dbinom2(x, size, prob, log = FALSE)

Arguments

x

vector of quantiles

size

number of trials (zero or more). Unlike base 'dbinom' doesn't have to be an integer

prob

probability of success on each trial

log

logical; if TRUE, probabilities p are given as log(p)

Author(s)

Devin S. Johnson


Fit observer by occasion model to NFS resight data

Description

Fit the observer by occasion model using maximum likelihood. The parameters, covariance matrix, and log-likelihood are returned in a list.

Usage

fit_oo(data, M, start_val = NULL, refit = TRUE, ...)

Arguments

data

A data frame containing the resight information. The data must contain the columns (1) 'obs'– the categorical name of the observer. (2) 'resample'– a variable indicating the resample occasion (3) 'm'– the counts of marked pups by each observer (4) 'u'– the counts of unmarked pups

M

the total number of unmarked pups in the population

start_val

an optional vector of starting values for the model

refit

logical. should the function attempt a refit to help ensure global optimum is reached

...

holding space for any other variable supplied, these will be ignored


Draw posterior sample using Sample-Importance-Resample algorithm

Description

Uses SIR methodology to draw a sample from the posterior distribution. A MVN proposal is used based on the MLE list output of the model fitting function

Usage

get_IS_sample(fit, data, M, res = 5000, initial = 10000, ...)

Arguments

fit

A list produced by ‘fit_oo’ function

data

The resampling data

M

the total number of pups shear marked

res

the size of the resample

initial

size of the initial sample from the MVN proposal

...

holding space for any other variable supplied, these will be ignored


log likelihood funtion for observer by occasion model

Description

calculate log-likelihood for the observer by occassion model

Usage

ln_lik_oo(par, M, u, m)

Arguments

par

parameter vector

M

Number of marks distributed

u

vector on unmarked animals counted by each observer on each occasion

m

vector on marked animals counted by each observer on each occasion

Author(s)

Devin S. Johnson


Load raw example data

Description

Load the 2016 shearing data into the global workspace.

Usage

load_demo_data()

View demonstration

Description

This function allows users to access a full step-by-step guide for using 'pupR' and other packages in the R statistical environment for estimating northern fur seal pup production.

Usage

see_demo()

Locate raw example data

Description

Show the location of the installed raw data .csv files for the 2016 shearing season

Usage

show_data_loc()

Summarize the posterior sample

Description

Here we summarize the posterior sample into a table for each rookery

Usage

summarize_oo(SIR, M, ...)

Arguments

SIR

a matrix of posterior samples from the ‘get_IS_sample’ function

M

total number of sheared pups

...

holding space for any other variable supplied, these will be ignored