Comments (11)
Hi Paola,
In the joint move persistence model jmpm
, the variance parameter for the random walk on γt is shared among individuals, which can lead to optimizer errors (like the one you've encountered) if the tracks being fit represent very different movement patterns. I don't think the different ranges in longitude should matter though.
You could explore this by iteratively removing individual tracks and re-fitting the jmpm
, but as the mpm
fits did not return errors then you can just go with these. In practice, the γt estimates should be similar.
Ian
from animotum.
Hi Ian,
Okay, I'll go with the mpm fits then. Thank you for the explanation and for your help!
Paola
from animotum.
Hi Ian,
I'm trying to fit_mpm
on southern elephant seal tracks.
I also had the same problem as Paola when I fitted all the animals together in a jmpm
so I tried fitting them 1 by 1 instead as an mpm
. It worked for most but still had some individuals which failed to converge.
My code for e.g. one of the failed individuals
fit <- foieGras::fit_ssm(d3 %>% filter(id == 'mq4-Billie-00'),
vmax = 4,
map = list(psi = factor(NA)),
model = "crw",
time.step = 24)
fit_mpm(fit, what = "predicted", model = "mpm", control = mpm_control(verbose = 0))
and the output from the code above:
Error in nlminb(obj$par, ifelse(control$verbose == 1, myfn, obj$fn), obj$gr, :
NA/NaN gradient evaluation
# A tibble: 1 × 4
id mpm converged model
<chr> <named list> <lgl> <chr>
1 mq4-Billie-00 <try-errr [1]> FALSE mpm
When I check what's the try-errr[1]
under the mpm
column:
$`mq4-Billie-00`
[1] "Error in opt[[\"par\"]] : subscript out of bounds\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError in opt[["par"]]: subscript out of bounds>
Are there any possible solutions from this point? I've tried changing the pre-filtering vmax = 2
but didn't make a difference.
I'm also not familiar with how to tweak the mpm_control
settings so any help is greatly appreciated!
from animotum.
Hi Dahlia,
I'd need to see the data, or a subset that produces the error to see if there's a solution.
Thanks, Ian
from animotum.
Hi Ian,
I wanted to try testing different vmax
and timestep
inputs into fit_ssm
first as I realise they affect the model convergence for fit_mpm
. I've settled at vmax = 4
and timestep = 4
.
When I use a different vmax the individuals that failed to converge during the mpm step varies - so I'm wondering if using a different vmax
only for problem individuals is advisable?
In any case I've attached the data for the problem seals.
Hi Dahlia,
I'd need to see the data, or a subset that produces the error to see if there's a solution.
Thanks, Ian
from animotum.
Sorry for delayed response, Dahlia. Using foieGras 1.0.0 (currently on GitHub only), I can get both the crw
SSM and the jmpm
to converge successfully when fitting to all 3 tracks and using vmax=4, time.step=4
. However, I'd say the first individual's track is a bit too short to infer anything sensible with fit_mpm
, and the 4-h time.step is probably too short for mpm inference (as per the figure below), a 6- or 12-h timestep would probably be more appropriate.
from animotum.
Thanks Ian! Using v.1.0.0 and changing it to a 12h time step worked for every seal.
from animotum.
Hi
I am having a similar error when using the fit_ssm function, I just cant work out how to resolve...
I too am a newbie to R so any explicit code to help me resolve this would be appreciated
The code is as follows:
Account for location error at observed irregular time interval
fit_crw_fitted <- fit_ssm(dat2, vmax = 1, model = "crw", time.step = NA,
control = ssm_control(verbose = 1))
map = list(rho_o = factor(NA))
print(fit_crw_fitted)
Estimate 'true' locations on irregular sampling interval (by setting
time.step = NA
)fit_crw_fitted <- fit_ssm(dat2, vmax = 1, model = "crw", time.step = NA,
-
control = ssm_control(verbose = 1))
fitting crw SSM to 2 tracks...
pars: 0 0 0 0 Error in nlminb(obj$par, ifelse(control$verbose == 1, myfn, obj$fn), obj$gr, :
NA/NaN gradient evaluation
pars: 0 0 0 0 Error in nlminb(obj$par, ifelse(control$verbose == 1, myfn, obj$fn), obj$gr, :
NA/NaN gradient evaluation
In addition: Warning message:
The optimiser failed. Try simplifying the model with the following argument:
map = list(rho_o = factor(NA))
Warning message:
The optimiser failed. Try simplifying the model with the following argument:
map = list(rho_o = factor(NA))
map = list(rho_o = factor(NA))
print(fit_crw_fitted)
A tibble: 2 × 5
id ssm converged pdHess pmodel
1 C5978 <ssm [7]> FALSE FALSE crw
2 C5979 <ssm [7]> FALSE FALSE crw
from animotum.
Thanks for providing the output and All_example.csv
file, but I'l need to see your code that goes from reading in All_example.csv
through to generating dat2
- the data input to fit_ssm()
in your above example.
from animotum.
from animotum.
Ok, I just need to see the structure of dat2
to help understand why you're getting convergence failures.
You attached All_example.csv
to your previous msg, just save dat2
from R (e.g., write.csv(dat2, file = "dat2.csv")
) and add a link to it in your next msg. That way I can try running your code on your data and see if I get the same (failed) result.
Failing that, you could just type dat2
in your R console and copy the first few lines (including column names) into this form. Then I can at least see if the data are structured properly. I suspect they're not and that's why you're getting the convergence failures.
from animotum.
Related Issues (20)
- min.dt likely not working as intended HOT 13
- map fit_ssm HOT 1
- when none of the input locations from any of the tracks are on land, route_path fails HOT 1
- installation and library(aniMotum) on M2 MBP HOT 4
- Package `foieGras` archived on CRAN and will be removed from the Tracking CTV HOT 1
- error with map function HOT 1
- When running function fit_ssm : Error in MakeADFun. Is someone familiar? HOT 2
- errors when running fit_ssm in animotum HOT 8
- Issue in installing foieGras package in RStudio HOT 3
- Error in if (p.GL > 0.75) { : missing value where TRUE/FALSE needed HOT 5
- not sure if bug or system issue HOT 3
- Error with sim_fit() using different gradient raster HOT 9
- rep$pdHess : $ operator is invalid for atomic vector — Error when fitting ssm HOT 9
- Error in strsplit(names(map), "_") : non-character argument HOT 1
- osar function not finishing the run HOT 2
- Date/time variable not detected in data HOT 6
- Missing packages for Mac M1 binary? HOT 3
- Issue with grad object for sim_fit() HOT 1
- manual download binary version animotum HOT 1
- Error when fitting an example fit_ssm: Error in updateCholesky(L, hessian.random) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animotum.