From 2e8cb6285367fb1ebab7ccdf530defe1da48c296 Mon Sep 17 00:00:00 2001 From: Ian Jonsen Date: Mon, 29 Apr 2024 11:50:44 -0300 Subject: [PATCH 1/2] fixed error when grad specified --- R/sim_fit.R | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/R/sim_fit.R b/R/sim_fit.R index b27ca6ca..5e34822b 100644 --- a/R/sim_fit.R +++ b/R/sim_fit.R @@ -121,10 +121,10 @@ sim_fit <- mu } } - + ## set up simulation extents if(!is.null(grad)) { - ex <- ext(grad[[1]]) + ex <- ext(grad) } else { ## approx extents of world mercator in km ex <- c(-20077.51,20082.49,-19622.54,18437.46) @@ -203,8 +203,7 @@ sim_fit <- mu1 <- reflect_y(mu1, ex[3:4]) if(!is.null(grad)) { - pv <- as.numeric(c(extract(grad[[1]], rbind(mu1))[1], - extract(grad[[2]], rbind(mu1))[1])) + pv <- as.numeric(extract(grad, rbind(mu1))) if(all(is.na(pv))) pv <- c(0,0) # unsure why NA's can creep in here mu[i,] <- mu1 + pv * beta @@ -259,8 +258,8 @@ sim_fit <- mu1 <- wrap_x(mu[i-1,] + dxy, ex[1:2]) mu1 <- reflect_y(mu1, ex[3:4]) if(!is.null(grad)) { - pv <- as.numeric(c(extract(grad[[1]], rbind(mu1))[1], - extract(grad[[2]], rbind(mu1))[1])) + pv <- as.numeric(extract(grad, rbind(mu1))) + if(all(is.na(pv))) pv <- c(0,0) # unsure why NA's can creep in here mu[i,] <- mu1 + pv * beta } else { mu[i,] <- mu1 From 691a06a62092645eb3697e1b9bfa726b92279515 Mon Sep 17 00:00:00 2001 From: Ian Jonsen Date: Mon, 29 Apr 2024 11:54:21 -0300 Subject: [PATCH 2/2] incr version --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e6094757..4b0b9f94 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: aniMotum Title: Fit Continuous-Time State-Space and Latent Variable Models for Quality Control of Argos Satellite (and Other) Telemetry Data and for Estimating Changes in Animal Movement -Version: 1.2-04 -Date: 2024-02-14 +Version: 1.2-05 +Date: 2024-04-29 Authors@R: c( person(given = "Ian",