curveModel: Curve Model Structure

View source: R/SGAT.R

curveModelR Documentation

Curve Model Structure

Description

Light Curve Model Structures for Stella and Estelle

Usage

curveModel(
  time,
  light,
  segment,
  calibration,
  alpha,
  beta,
  logp.x = function(x) rep.int(0L, nrow(x)),
  logp.z = function(z) rep.int(0L, nrow(z)),
  x0 = NULL,
  z0 = NULL,
  fixedx = FALSE,
  dt = NULL
)

curveModel0(
  time,
  light,
  segment,
  calibration,
  alpha,
  logp.x = function(x) rep.int(0L, nrow(x)),
  logp.z = function(z) rep.int(0L, nrow(z)),
  fixedx = FALSE
)

Arguments

time

vector of sample times as POSIXct.

light

vector of observed (log) light levels.

segment

vector of integers that assign observations to twilight segments.

calibration

function that maps zenith angles to expected light levels.

alpha

parameters of the twilight model.

beta

parameters of the behavioural model.

logp.x

function to evaluate any additional contribution to the log posterior from the twilight locations.

logp.z

function to evaluate any additional contribution to the log posterior from the intermediate locations.

x0

suggested starting points for twilight locations.

z0

suggested starting points for intermediate locations.

fixedx

logical vector indicating which twilight locations to hold fixed.

dt

time intervals for speed calculation in hours.

Details

Stella and Estelle require a model structure that describes the model being fitted. These function generate basic model structures for curve fitting methods that should provide a suitable starting point for most analyses.

The curveModel function constructs a model structure assuming that each twilight profile is associated with a single location. The errors in observed log light level are assumed to be Normally distributed about their expected value.

The initialization locations x0 and z0 must be consistent with any other constraints imposed by the data.

Both Estelle and Stella variants of the model assume that the average speed of travel between successive locations is Gamma distributed, and for Estelle models, the change in bearing (degrees) along the dog-leg path segments can be assumed Normally distributed with mean zero. By default, the speed of travel is calculated based on the time intervals between the twilights (in hours), but the intervals of time actually available for travel can be specified directly with the dt argument.

If beta is a vector, then beta[1] and beta[2] specify the shape and rate of the Gamma distribution of speeds. If beta has three elements, then beta[3] specifies the standard deviation of the change in bearing (in degrees) along dog leg paths.

The curveModel0 function constructs only the non-movement elements of the model, and can be used as a basis for those wishing to experiment with alternative movement models.

Value

a list with components

logpx

function to evaluate the contributions to the log posterior from the twilight model

logpz

function to evaluate the contributions to the log posterior from the prior for the z locations

estelle.logpb

function to evaluate contribution to the log posterior from the behavioural model for estelle.

stella.logpb

function to evaluate contribution to the log posterior from the behavioural model for stella.

fitted

function to evaluate the fitted values for a given set of locations.

fixedx

a logical vector indicating which locations should remain fixed.

x0

an array of initial twilight locations.

z0

an array of initial intermediate locations.

time

the sample times.

light

the recorded light levels.

segment

vector of integers that assign observations to twilight segments.


SWotherspoon/SGAT documentation built on June 1, 2022, 10:49 p.m.