ctmm-initiative / ctmm

Continuous-Time Movement Modeling. Functions for identifying, fitting, and applying continuous-space, continuous-time stochastic movement models to animal tracking data.
http://biology.umd.edu/movement.html
47 stars 12 forks source link

question about model fitting result #24

Closed xhdong-umd closed 6 years ago

xhdong-umd commented 6 years ago

I found sometimes the model fitting result can have very large speed values. Is this normal?

I only tested the sample data instead of full data, it could be the small sample make the fit more difficult.

library(ctmm)
library(ctmmweb)
data(buffalo)
# take a 100 point sample from each animal to speed up model fitting etc
data_sample <- pick(buffalo, 100)
gabs <- data_sample[["Gabs"]]

> gabs_res <- ctmm.select(gabs, ctmm.guess(gabs, interactive = FALSE),
+                         trace = TRUE, verbose = TRUE)
* Fitting models OUF anisotropic
* Fitting models OU anisotropic
> names(gabs_res)
[1] "OU anisotropic"  "OUF anisotropic"
> summary(gabs_res[[1]])
$DOF
    mean     area 
5.531994 9.749383 

$CI
                                low         ML     high
area (square kilometers) 163.098123 343.926343 591.0683
tau position (days)        3.098123   9.140578  26.9680

> summary(gabs_res[[2]])
$DOF
    mean     area 
5.532760 9.754996 

$CI
                                  low          ML         high
area (square kilometers)   163.114819  343.873892 5.908988e+02
tau position (days)          3.099329    9.139031 2.694838e+01
tau velocity (miliseconds)   0.000000    8.972539 2.918452e+05
speed (kilometers/day)       0.000000 6527.046938 1.177160e+06
chfleming commented 6 years ago

Yes, as you thin the data the effective sample size of speed (which I don't have printed out in summary() yet) goes to zero, and the confidence intervals widen out and the point estimate becomes upwards biased. The confidence intervals remain pretty good, though. As you can see here, the lower confidence interval has bottomed out at zero, while the upper confidence interval is 200x the point estimate. The effective sample size for speed here is probably less than 1. That estimate will be going into summary() very soon.

chfleming commented 6 years ago

I'll leave this issue open until I update summary().

xhdong-umd commented 6 years ago

OK. Once summary updated I need to check if all my model summary code need to be adjusted.

We can also note this in app help for using sampled data in app test so user will not think it as a bug.

chfleming commented 6 years ago

summary.ctmm() now reports a DOF[speed].

On another note, ctmm.select() is now automating some multi-stage fitting, which should help when fitting with errors.

xhdong-umd commented 6 years ago

This is the DOF speed values for my test data:

> summary_dt$`DOF speed`
 [1] 0.000000e+00 4.481233e-02 0.000000e+00 2.425004e-08 0.000000e+00 8.340052e+00 6.218175e+01
 [8] 0.000000e+00 7.294972e+00 0.000000e+00 0.000000e+00 1.251285e+01 7.169899e+00

Usually I will round up the numbers in the model summary table to 3 digits after decimal point. If I round these values too, some smaller value may look like to be just 0. Is that OK?

chfleming commented 6 years ago

Rounding to zero is fine. These numbers are going to be compared to the number of sampled locations, so even rounding to the nearest tenth would be acceptable.