argos2tmb: Correlated Random Walk Filter

Description Usage Arguments Details Value

View source: R/argos2tmb.r

Description

Format a track data for filtering

Usage

1
argos2tmb(d, tstep = 1, extrap = FALSE, amf = amfCRAWL())

Arguments

d

a data frame of observations (see details)

tstep

the time step to predict to (in days)

extrap

if TRUE, the final predicted state occurs immediately before the last observation, otherwise the final predicted state occurs immediately after the last observation.

amf

Argos error scale mmultiplication factors

Details

This is an internal function used by rwg to format track data for the TMB filter.

The input track is given as a dataframe where each row is an observed location and columns

'date'

observation time (POSIXct,GMT),

'lon'

observed longitude,

'lat'

observed latitude,

'lc'

ARGOS location class.

From this it calculates interpolation indices idx and weights ws such that if x is the matrix of predicted states, the fitted locations are ws*x[idx+1,] + (1-ws)*x[idx+2,]. If extrap is TRUE, the final observations occur after the final predicted state and the fitted locations are extrapolations from the final states, otherwise the final observations occur before the final predicted state and all fitted locations are interpolations.

By default the function uses the same ARGOS multiplication factors to scale location accuracy by location class as used in the crawl R-package.

Value

A list with components

y

a 2 column matrix of the lon,lat observations

K

a 2 column matrix of the ARGOS scale factors

idx

a vector of interpolation indices

ws

a vector of interpolation weights

ts

the times at which states are predicted (POSIXct,GMT)

dt

the time step at which states are predicted (secs)


ianjonsen/bssm documentation built on July 3, 2017, 10:33 p.m.