Git Product home page Git Product logo

argostrack's Introduction

argosTrack: Fit Movement Models to Argos Data for Marine Animals

Installing

The argosTrack package requires TMB to be installed.

The development version of argosTrack can be installed with

devtools::install_github("calbertsen/argosTrack/argosTrack", ref = "master")

argostrack's People

Contributors

calbertsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

argostrack's Issues

package ‘argosTrack’ is not available (for R version 3.3.2)

Hello --

I'm writing to inquire if this package is still being maintained (and plans for long-term maintenance). I received an error upon install that it is not available for 3.3 (and R is now on 3.4). Seems to have some advantages over crawl and was hoping to try it out.

Thanks!

trouble installing argosTrack

Hello,

I am trying to install argosTrack trying both:
R> devtools::install_github("calbertsen/argosTrack")
R> devtools::install_github("calbertsen/argosTrack",ref="mac")

but am encountering this error:
Error: HTTP error 404.
Not Found
Did you spell the repo owner (calbertsen) and repo name (argosTrack) correctly?

  • If spelling is correct, check that you have the required permissions to access the repo._**

I have have devtools and TMB installed and am running R on Mac 10.13.6 High Sierra.
Have you encountered this before?

Any help would be much appreciated. Thank you for your work on this package - I'm looking forward to trying it out.

Melinda

Export model output to dataframe

Hi Christoffer,

Is there a way that I can export the model output (i.e., the predicted animal track) to a data.frame or spatial data.frame in R so I can use it in other packages (e.g., momentuHMM) to run behavioral predictions and use covariates (e.g., SST, currents, distance to nesting beach, etc.)? Also, I would like to be able to export to a TXT or CSV file so I could import into ArcGIS.

Is it also possible to have the SD or SE of the model predictions plotted with the latitude and longitude plots so I can assess the fit of the model to the original data?

I'm still newish to R, so forgive me if any of these questions are relatively simple.

Thanks in advance for the help!

error running vignette examples

Good day,
I am not able to run the code example argosTrack.R that I found in the supplementary of the Ecology2015 paper with the subadult_ringed_seal dataset here http://esapubs.org/archive/ecol/E096/229/suppl-1.php even if TMB run properly in my computer.
The error appears when trying to fit the argosTrack function
fitobj <- do.call(argosTrack,args)
and get
"Error in as.character(sys.call(sys.parent())[[1L]]) :
cannot coerce type 'closure' to vector of type 'character' "

R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)

Thank you for your help and your work on this package
best regards

Predicting unkonwn locations at known times

Hi Dr. Albertsen,

I was wondering how to predict unknown locations from a fitted movement model using the state-space approach of {argosTrack} in a manner similar to Johnson et al. (2011) and Fleming et al. (2016). My first guess is that you could interleave times that you want to predict locations at (like every 6 hours) with the observed data and then tell {argosTrack} not to include them in the measurement likelihood. Although, this introduces more estimated random effects (resulting in more random effects than observed data, so perhaps not a good approach). And currently doesn't work (probably for good reason; see code below).

I'm most interested in the CTCRW movement model, and I was wondering if it would be possible to use the kriging approach from the Fleming et al. (2016) paper to predict unknown locations from a fitted movement model using {argosTrack}. Seems possible, just not sure how to start off. The kriging approach just requires a mean and autocorrelation function to be specified, and some assumptions about normality (from what I can tell). From here, we see that the covariance for locations ($x$) at times $t$ and $t'$ of the CTCRW movement model is defined as:

$$ \text{Cov}[x(t),x(t')] = \frac{\sigma^2}{2a^3}\left(2e^{-at}-e^{-a(t+t')}-e^{-a|t'-t|}+2e^{-at'}+2\min(t,t')-2\right). $$

where the CTCRW model is derived from the following sdes,

$$ dx_t = v_tdt $$

with velocity ($v_t$) as an OU process

$$ dv_t = a(b-v_t)dt + \sigma dW_t. $$

Although, they derive the $\text{Cov}$ assuming $\mathbf{b} = \mathbf{0}$ (so that may throw a wrench in things, if it's of interest to also estimate $\mathbf{b}$). Just wanted to get your thoughts and thank you for the great R pkg! I know there is {ctmm} and {crawl}, but I like the flexibility of using TMB on the backend.

library(argosTrack)
library(dplyr)
library(magrittr)

## example data from {argosTrack}
dat = subadult_ringed_seal %>%
  mutate(date = as.POSIXct(date))

## remove duplicated timestamps
dat %<>% arrange(date) %>% 
  dplyr::filter(duplicated(date) == FALSE)

## datetimes to predict unknown locations from the fitted movement model
preds = tibble(include = FALSE, 
               date = seq(min(dat$date), max(dat$date), by = '6 hours'))

## merge predicted times with the "observed" data
ex_dat = dplyr::bind_rows(dat, preds) %>% 
  arrange(date) %>%
  mutate(include = ifelse(is.na(include), TRUE, include))

## remove duplicated dates introduced by rbinding preds (keep observed, remove pred)
ex_dat %<>% arrange(date, -include) %>%
  dplyr::filter(duplicated(date) == FALSE)

## set up Observation obj.
obs = Observation(lat = ex_dat$lat,
                  lon = ex_dat$lon,
                  dates = ex_dat$dates,
                  locationclass = ex_dat$lc,
                  include = ex_dat$include
                  )

Error in .Object$initialize(...) : 
  lon can not have NULL, NA, or NaN  elements.

date line crossing animals, mapping functions centered on 0

The plotting functions currently do not allow for date-line crossing (i.e. Pacific Ocean centered data in which the origin is 180 longitude). This makes it difficult to use the built in visualization functions for my data which cross the Pacific. Are there additional implications of this? I would have thought the lat and long data would have needed to be projected. Thanks very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.