Learn R Programming

⚠️There's a newer version (0.2.1) of this package.Take me there.

bayesmove

Introduction

The goal of bayesmove is to analyze animal movement using a non-parametric Bayesian framework, which addresses a number of limitations of existing segmentation methods and state-space models. This framework allows the analysis of multiple telemetry and biologging data streams, which must be discretized into a set of bins before they can be analyzed. This package also includes features to check model convergence. Model output are often returned in a format that is tidyverse-friendly, which allows for easy visualization using ggplot2.

Installation

You can install the latest CRAN release with:

install.packages("bayesmove")

You can install the latest stable version of the package from GitHub with:

# install.packages("remotes")
remotes::install_github("joshcullen/bayesmove")

Support

If you are receiving errors from the model output that you believe to be bugs, please report them as issues in the GitHub repo. Additionally, if there are any other features you would like added to this package, please submit them to the issue tracker.

Copy Link

Version

Install

install.packages('bayesmove')

Monthly Downloads

259

Version

0.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Joshua Cullen

Last Published

October 16th, 2020

Functions in bayesmove (0.1.0)

behav_seg_image

Internal function that transforms a vector of bin numbers to a presence-absence matrix
assign_behavior

Assign behavior estimates to observations
df_to_list

Convert data frame to a list by animal ID
assign_tseg_internal

Internal function that adds segment numbers to observations
CumSumInv

Internal function that calculates the inverted cumsum
discrete_move_var

Discretize movement variables
cluster_segments

Cluster time segments into behavioral states
behav_gibbs_sampler

Internal function that runs RJMCMC on a single animal ID
assign_tseg

Add segment numbers to observations
SampleZAgg

Internal function that samples z1 aggregate
get_breakpts

Extract breakpoints for each animal ID
prep_data

Calculate step lengths, turning angles, and time steps
prep_data_internal

Internal function to calculate step lengths, turning angles, and time steps
get_summary_stats

Internal function that calculates the sufficient statistics for the segmentation model
get_MAP

Find the maximum a posteriori (MAP) estimate of the MCMC chain
%>%

Pipe operator
log_marg_likel

Internal function that calculates the log marginal likelihood of each model being compared
get.theta

Internal function to calculate theta parameter
tracks.seg

Segmented tracks for all IDs.
get_behav_hist

Extract bin estimates from Latent Dirichlet Allocation model
get_MAP_internal

Internal function to find the maximum a posteriori (MAP) estimate of the MCMC chain
plot_breakpoints

Plot breakpoints over a time series of each movement variable
summarize_tsegs

Summarize observations within bins per track segment
plot_breakpoints_behav

Internal function for plotting breakpoints over each of the data streams
rmultinom1

Internal function that samples z's from a categorical distribution
sample.phi

Internal function to sample bin estimates for each movement variable
sample.v

Internal function to sample parameter for truncated stick-breaking prior
traceplot

View trace-plots of output from Bayesian segmentation model
rmultinom2

Internal function that samples z's from a multinomial distribution
tracks

Simulated set of three tracks.
expand_behavior

Expand behavior estimates from track segments to observations
extract_prop

Extract behavior proportion estimates for each track segment
filter_time

Filter observations for time interval of interest
tracks.list

Tracks discretized and prepared for segmentation.
round_track_time

Round time to nearest interval
find_breaks

Find changes for integer variable
sample.z

Internal function to sample latent clusters
samp_move

Internal function for the Gibbs sampler within the reversible-jump MCMC algorithm
segment_behavior

Segmentation model to estimate breakpoints