No units and no rounding on tau estimates
Closed this issue · 86 comments
Can you share the data and steps to reproduce the problem? Otherwise I have no way to check on the problem. Thanks!
Interestingly, using the data you provided and the most recent ctmm github version, I actually didn't see the unit problem.
The hosted app has a older ctmm version (CRAN version), but it doesn't has unit problem too.
In script
library(ctmm)
library(ctmmweb)
user_data <- "/Users/xhdong/Projects/ctmm-Shiny/data/user data/Mark/dat_E51_2014_ctmmweb.csv"
tele_list <- ctmmweb:::wrap_single_telemetry(as.telemetry(user_data))
model_try_res <- par_try_models(tele_list)
model_summary <- summary_tried_models(model_try_res)
Is there any data or reproducible steps for this? For last case I tested with the user data and didn't find the problem.
This problem can actually be tested with script, just like the script example I gave above.
And are they running the latest github version? There have been some updates since the release version.
They used the installer, does that automatically pull the most up to date version?
That will install the release version by default. After the installation, there should be a link to install github version in ctmmweb start menu. I can also update the release version later.
@jmcalabrese @chfleming @NoonanM
I'm wondering if the installer should install the github version by default instead:
- My daily work branch is
daily
, so any experimental or feature in working goes to this branch - Only after a feature/bug is completed and tested, the
master
branch get updated. The user always install frommaster
branch when installing from github. - The
release
is a picked version that with more tests.
The reasoning about installing release version is that it's more stable and went through more tests. However that also means it didn't get the new bug fixes as soon as possible. For every update we need more manual work to update release too. Since each master
branch update went through some tests and are always feature complete, I think it's actually better for user to install from master
. It may not have that many tests in release, but to test everything in every update will simply cost too much time, we may need to rely on user to report bugs anyway.
That probably makes sense for both ctmmweb
and ctmm
at this stage of development.
I have generated a new installer ctmmwebsetup_beta
which will install github version by default, and put it in the github webpages. I also updated the hosted app to the most recent version.
In the current AniMove class, we have 13 students all using the exact same subsample of the buffalo data and 2 students encountered the units bug.
We need more information or reproducible examples to track down the problem. It's likely to be a platform/locale related thing and hard to test without examples.
I'll leave the issue open but added a label so that it's clear we need reproducible example to go ahead.
@xhdong-umd I have forwarded you an email where a user has produced this issue with data attached.
Thanks Chris for your quick answer to our message (Fernanda Cavalcanti and Fernando Azevedo). Please let us know if you need more details on this issue.
@Ferazevedo , I cannot load Wojtyla_F2.csv into ctmmweb directly. There is the error of timestamp format. It's the same if I load it through ctmm::as.telemetry
> tele_list <- as.telemetry("d:/Work/R/ctmm-shiny/data/Fernanda/Wojtyla_F2.csv")
Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
Did you use this csv in your session and can load it without problem?
I also looked at the previous cases of similar error. I run their data again and still no problem. Then I looked at the screen shot again, @NoonanM , @chfleming , I'm guessing the user have some different locale/unicode settings. You can see the tao in their screenshot look like T, it's not really tao.
The screenshot from user from beginning has T
:
The saved report html from Mark's dat_E51_2014 has t
My version has tao:
I have some code to set unit and convert values for tao column. If tao column came back as a different name, my code will not find it and will not convert it correctly.
This can explain why some users in a class met problems when they are using same data. They probably have different locale/unicode related settings.
Unicode can be tricky, I'm not sure if there is a more fail proof way to get these column names correctly without impact from user's locales.
Another test is that if user can use the hosted app and get correct result, that means there is no problem with the data, just some difference in their local configuration.
Hi, no I did not run these two data sheets into ctmmweb directly. I had to upload both of them into Movebank, format the timestamp and then import those data while using ctmmweb.
@Ferazevedo , can you save the formatted file from movebank or ctmmweb (if you used ctmmweb to import from movebank directly)? Or you can save the session data as a zip, that will include the formatted csv too. I'd like to have exactly same input file to test if possible.
Yes, just sent you and email with all data you requested exported from ctmmweb
Only data from aninal Xinxia works properly in ctmmweb. The other two animals, information like velocity and speed are not provided
The email above might replied to github notification address, and I didn't see any attachment. You can reply the other thread with my email address to send the attachments.
Hi Xhdong, just sent it again. Let me know if you received it. Thanks.
@Ferazevedo , I did receive the data.
Besides, can you do a simple test? Just run this in R console and post the screenshot of result.
> print("\u03C4[position]")
[1] "τ[position]"
Just these two commands?
print("\u03C4[position]")
[1] "τ[position]"
[1] "τ[position]"
Error: unexpected '[' in "["
I'm still getting timestamp format error, since the timestamp is still non-standard. Can you save the session data through save progress
button on left side menu, after you finished model fitting?
For the test, you only need to run first line, and the 2nd line is my result. Looks like your result is same with mine.
Here just the first line
print("\u03C4[position]")
[1] "τ[position]"
Yes, I can save it...just give me a minute to run the analysis
When I export data from ctmmweb, I got the timestamp in standard ISO format like this. Not sure why you got a different format.
timestamp,longitude,latitude,t,x,y,identity,row_name,id,row_no
2005-07-14 05:35:00,31.88776042,-24.96738078,1121319300,35215.7570159228,836.733839195844,Cilla,4109,Cilla,1
that´s what I´ve been struggling with... do you think it can be related to my computer configuration? Perhaps excel configuration...?
The wierd thing is that I can run the whole analysis in ctmmweb using one animal, but not with the others...using the same data sheet format.
Just sent you the zip file with the saved progress after running the model selection
@chfleming , here is the progress report from @Ferazevedo . In my eyes I think all the tau columns have the units and rounding, so this is a little bit different from the problems we met in this issue.
Some model have NA value might relate to the model type. Some value do look to be quite big but I'm not sure if that's normal.
Sorry I misread the table. My result is same with @Ferazevedo . tau is a separate column.
@Ferazevedo , did you use the latest ctmm and ctmmweb version?
I guess so...
Run app from our website
Just open https://tiny.cc/ctmmweb (Chrome recommended). This will have some resource limitations compare to run the app locally.
@chfleming , Is there a unit for tau? This might be a new column so I didn't round it with a unit. Previously we only have tau position, tau speed etc, as seen in previous screenshot.
@Ferazevedo you don't have to run on hosted app. I got same result with yours. I misread the table in the beginning.
sorry, what do you mean by hosted app? When I start ctmmweb through R, I get the same issue problems...
https://tiny.cc/ctmmweb is the hosted app.
Got it, tau is time. This is a new column from ctmm model summary so I didn't convert it.
This looks to be issue mentioned by @chfleming on #86.
Though I'm not sure about copying tau estimate to both tau_position and tau_velocity. That looks to be a little too specific. ctmm will still report tau_position and tau_velocity as NA, right? I'm a little less comfortable to show result different from ctmm result.
Master branch updated. @Ferazevedo you can test it with
if (!require("remotes")) install.packages("remotes")
remotes::install_github("ctmm-initiative/ctmmweb")
I did run it again, no changes for me...the first two animals with no info on T velocity and speed
Whether there is info on certain column depend on model type. As long as the column unit and rounding is correct, that should be what it is from ctmm. You may need to ask @chfleming about whether there should be value for certain models.
Did you get same result with the table I posted above?
No, different results
The OUf tau
is equivalent to both tau[position]
and tau[velocity]
, which are constrained to be equal in that model. Rather than make a new column, I would copy tau
to both columns.
@Ferazevedo , the report you sent is still using older version:
Hi Xianghui, I am running ctmm through R studio. I used the commands you sent me yesterday
ctmmweb::app()
if (!require("remotes")) install.packages("remotes")
remotes::install_github("ctmm-initiative/ctmmweb")
Am I missing something?
You need to install new version first then run app(). Did you install a new version?
if (!require("remotes")) install.packages("remotes")
remotes::install_github("ctmm-initiative/ctmmweb")
with this new version, my R is no longer starting ctmmweb
I got this message in ctmm: Error: argument is missing with no default
Can you post the full message, like screenshot? Please update again as I'm also updating the code to fix some tau columns.
Loading required package: ctmm
Error: package or namespace load failed for ‘ctmm’ in match.fun(FUN):
reached elapsed time limit
still not working
if (!require("remotes")) install.packages("remotes")
remotes::install_github("ctmm-initiative/ctmmweb")
Skipping install of 'ctmmweb' from a github remote, the SHA1 (d982266) has not changed since last install.
Useforce = TRUE
to force installation
ctmmweb::app()
Listening on http://127.0.0.1:5252
[2020-09-03 14:51:14.249] Package Build Info
- RemoteType: github
- RemoteHost: api.github.com
- RemoteRepo: ctmmweb
- RemoteUsername: ctmm-initiative
- RemoteRef: master
- RemoteSha: d982266
- Packaged: 2020-09-03 17:49:44 UTC; fazev
- Built: R 3.6.0; ; 2020-09-03 17:49:47 UTC; windows
[2020-09-03 14:51:14.287] App launched from app() call
Warning: Error in tag: argument is missing, with no default
102: tag
101: tags$div
100: div
99: fluidRow
97: renderMenu [C:/Users/fazev/OneDrive/Documentos/R/win-library/3.6/ctmmweb/app/server.R#36]
96: func
83: origRenderFunc
82: output$side_menus
2: shiny::runApp
1: ctmmweb::app
[2020-09-03 14:51:14.874] Recording is On
[2020-09-03 14:51:14.879] Diagnostic info printing to R Console
[2020-09-03 14:51:14.884] Parallel mode enabled
What is your R version?
Version 1.2.1335
© 2009-2019 RStudio, Inc.
You can run sessionInfo()
in R console, something like this:
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)
RStudio could be updated, but more important is your R version, like Xianghui said. The current version is 4.0.2 .
R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
I see my R is not updated...I will correct that now
R 4.0 is a quite significant update, you may want to update R. With this update you almost need to update all packages too.
I noticed your last working version is on 2020.03, after that we have some update in side bar menus. That update has been a while and never receive bug report. I suspect your shiny, shinydashboard is old too so there are errors on side bar menu.
it works now, thank you.
when runing model selection for the jaguar Wojtyla, I got the following message: Error: invalid type/length(closure/18) in vector allocation
so does the same for the other animals...for the jaguar Xinxia, the message goes Error: invalid type/length(closure/12) in vector allocation
and this message keeps popping up for all animals I try to model (model selection) with different closure/number between parentheses...
visualization of all animal is ok though
Do you have updated version of ctmm?
install.packages("ctmm")
i´ve used the commands you sent me
if (!require("remotes")) install.packages("remotes")
remotes::install_github("ctmm-initiative/ctmmweb")
That one will install ctmmweb, and may ask you whether to upgrade other packages. If prompted, you can update all CRAN packages.
You may need to at least update ctmm, which is the package that do the actual model fitting task. So you can just install CRAN version of ctmm with install.packages("ctmm")
it seems like using ctmm through R doesn´t work properly. If I use through your app, it does work yielding the outcomes we worked with yesterday
could you please let me know the order of the commands to run the R code properly? After the command install.packages ("ctmm") what should I type? Anything before or after that?
install.packages ("ctmm")
is used to update ctmm
package. Once that is updated, you can use ctmmweb app as before.
Can you get proper result in ctmmweb now? Using your data, I can get the model summary table like this (there is no longer a separate tau column, instead the value was copied to tau position and tau velocity for OUf model)
Yes, yes, exactly the same values...thank you very much...
Only working through your ctmmweb app i was able to get the results
I still don´t understand exactly how can i use some info from models that are not the selected best ones, for instance tau velocity and speed, together with info from the best selected model...
You wouldn't want to use parameter estimates from the non-selected models.
So Chris, we go back to the starting point of my first question. Why ctmm best selected model yields complete outcomes for one jaguar and not for the others?
If you are talking about Xinxia having speed estimates, while Braba and Wojtyla do not, it could be because of the coarseness of the data, the tortuosity of the jaguar's movement, the scale of the GPS location errors, or the amount of data.
Both Wojtyla and Braba have much more data locations than Braba, but still, no tau velocity and speed info
83% of all Wojtyla locations (total 2397) are 3D (1991 locations). Perhaps tortuosity...and have not inserted the error in my analysis, not yet, but I can try and see if it improves the outcome
Hi Chris, is there a way to deal with these issues (coarseness of the data, the tortuosity of movement, the scale of the GPS location errors)? Perhaps using part of the dataset?
Modeling the error can give a small improvement. Checking for outliers can help. If the movement behavior is non-stationary, then segmenting the data could help with the less tortuous states. But often times coarseness cannot be overcome.
Hi Chris, thanks for your input. Talking to Fernanda and reading some stuff here, I guess I figured that out. Although my data set for Wojtyla for instance has almost 3,000 locations, it has a lot of gaps in timelime among locations. GPS units from Followit were highly inefficient in the Pantanal of Brazil (less than 40% of all possible locations were recorded). So, those gaps may be affecting the outcome of ctmm models in estimating tau velocity and speed for some jaguars...
Do you think it is reasonable to use just a part of the locations (500 locations for instance) out of the whole dataset just to generate those parameters? I guess I may have some periods where more data has been gathered without so many gaps...
I don't think that would help. The inclusion of coarser data shouldn't be hindering anything with continuous-time methods.