Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import data error #3

Closed
Lisark45 opened this issue Feb 5, 2024 · 8 comments
Closed

Import data error #3

Lisark45 opened this issue Feb 5, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@Lisark45
Copy link

Lisark45 commented Feb 5, 2024

Thank you for your work on movedesign.
I'm looking forward to getting started, only I'm having problems uploading my own data to the app.

To test my data was properly formatted as per MoveBank conventions, I downloaded an existing MoveBank dataset, the
'Kruger African Buffalo, GPS tracking, South Africa' and uploaded it using the Import Data tab.
Upload is fine but it also crashes (as does my own data) after I select the individual 'Çilla' and attempt to validate.
Below are the error messages I received.

Can you recommend a fix please?

movedesign::run_app()

Listening on http://127.0.0.1:7124
Minimum sampling interval of 3 minutes in Cilla
Minimum sampling interval of 2 minutes in Gabs
Minimum sampling interval of 2 minutes in Mvubu
Warning in telemetry.clean(telist[[i]], id = id[i], OCCURRENCE = OCCURRENCE) :
Times might be out of order or duplicated in Pepper. Make sure that timeformat and timezone are correctly specified.
Minimum sampling interval of 1 minutes in Pepper
Minimum sampling interval of 2 minutes in Queen
Minimum sampling interval of 5 minutes in Toni
[2024-02-05 13:18:42]
✓ Success: File submitted.
Please select one individual from this dataset.
Error in try_select(input[[1]], trace = trace) :
unused argument (trace = trace)
Error in model selection
Warning: Error in par.ctmm.select: Error in try_select(input[[1]], trace = trace) :
unused argument (trace = trace)

126: stop
125: par.ctmm.select
124: guess_time
123: cachedReactiveValueFunc
121: valueFunc
106: func
104: f
103: Reduce
94: do
93: hybrid_chain
92: reactive:cachedReactive(key)
76: timing_fit
75: observe
74:
3: runApp
2: print.shiny.appobj
1:

@ecoisilva ecoisilva self-assigned this Feb 6, 2024
@ecoisilva
Copy link
Owner

I have been able to replicate the error, so I will work on a fix now. I will let you know once it is fixed!

@Lisark45
Copy link
Author

Lisark45 commented Feb 6, 2024

Thank you, much appreciated!

@ecoisilva
Copy link
Owner

I believe the problem has been fixed, but I have not extensively tested the app to confirm. Let me know if it does or does not work, or if anything else breaks in the meantime.

@Lisark45
Copy link
Author

Thank you very much, that works fine now with my data too.
You've done some really great work, just a couple of questions if you don't mind?

My data is bats with VHF every 5 mins for 32 days and I'm looking at home range.
The single simulation relative error range is -1.7% [-5.5%, 2.2%]
but uncertainty is still very high - the 95% credible interval on this error is [-51.5%, 95%].
And only when I compare with a design of 1024 days the credible interval is acceptable at [-19.7%, 18.2%]

Would you mind telling me how the credible intervals were calculated?
The '[-51.5%, 95%]' must be from the sampling distribution of relative errors, is that right?

But how is the quick comparison result for 1024 days of '[-19.7%, 18.2%]' obtained?
I'm a little concerned with the result, would we really have to sample every 5 mins for close to 3 years
to be confident with our home range estimate??

Could you also please explain the message
'To obtain valid credible intervals, select a different analytical target in the Home tab' - I can't see anything like that there.

Thanks!

@ecoisilva
Copy link
Owner

No worries, ask as many questions as you need!
I assume the uncertainty values you mention are the ones that show up in the Report tab/box, correct? Yes, this uncertainty range is based on the sampling distribution of relative errors for a particular set of pre-run simulations. The way it works is that it finds the closest pre-run timescale parameter (it should say which one in the report box), and the closest sampling duration (for home range), and shows the credible intervals of a set of 400 of those simulations. These ranges won't be entirely accurate compared to the ones obtained from your data/sampling parameters, they are just for a quick comparison between different durations (without requiring you to go through the whole workflow again; you can also use these to guide a new workflow where you set a longer sampling duration). Actually, could you share what Position autocorrelation timescale, τp, you are getting from your data? It should be visible in the Upload tab at the bottom. I can at least verify if that range [-51.5%, 95%] makes sense here, or if there is another error.

High uncertainty is typically due to long home range crossing times, resulting in wider confidence intervals for home range area estimates even for long sampling durations, so it not too unlikely to see those ranges anyway. Also, have you checked if your animals are range resident? This factor could also affect the outputs you are getting.

As for the message you mentioned, I am currently updating the app to enable users to run multiple simulations more easily, thereby obtaining more valid credible intervals than those currently displayed in the Report tab. I should be able to push the new update to the development version in the next few days, so you could also try it out with that feature as well.
Ultimately, I would favor your own workflow/set of simulations over the ones in the Report tab once these new features are added.

@Lisark45
Copy link
Author

Thankyou, I really appreciate your time and I look forward to trying out the new functionality when its available:)
I do have a couple more questions, so if you don't mind.....

I should probably add a little more about my data.
It's from the Motus network and localised with an algorithm that uses node positions and strength of signal.
Mostly fixes are 30 secs apart, but during the night there are many small gaps in fixes when the bat was either resting or out of range (hopefully not too often), and there are large gaps during each day when the bats were rooting.

I checked range residency and it looks like they're not range resident from this variogram. I suspect that means their range extends beyond the nodes and any estimate of home range is likely to be misleading :(
variogram

So I think the results in the report are not appropriate for this data.
However for the future can I please clarify;

  1. Relative error is 0.41%[-3.5,4.4] - the report says ''Your error estimate based on a single simulation was 0.4%'', so ctmm parameters from my sample data were used to simulate one other similar dataset and modes between the sample and the simulation were compared? Is that correct?
  2. Then ''..for a similar duration of 32 days, there is a 95% probability that the relative error will lie between -51.5% and 95%'', so ctmm parameters from my sample data were used to simulate 400 other datasets, this time with sample length 28 days and interval 5 mins. Is that correct?
  3. And ''The ideal sampling duration for home range estimation should be at least 30 position autocorrelation parameter (τp), or ≈ 7.8 hours. Your current duration is 2594 τp ≈ 672 hours,...'' seems to say duration is long enough enough, yet uncertainty between -51.5% and 95% indicates otherwise - is this because the range residence condition failed?

report

I would quite like instead to look at distance and speed but I get the Dataset Invalid error message i.e. '''No significant signature of the animal's velocity autocorrelation parameter remains in this dataset''. Is this likely because of the 30sec intervals of fixes?

@ecoisilva
Copy link
Owner

Okay, there's an issue with the report. The plots in the second figure you shared are based on a position autocorrelation of 1 day, while your extracted parameter is 15.5 minutes. Therefore, the uncertainty should indeed be way lower than what you are getting there. With an effective sample size of 2,462, your data should be more than sufficient for home range estimation. I will fix that!

However, I'm quite intrigued by two things here: (1) the home range crossing time of 15.5 minutes —this is very short, most species have crossing times on the order of days to weeks; (2) you mention most fixes being 30 seconds apart, which should be sufficient to detect a signature of the animal's velocity autocorrelation parameter. Both make me think that there might be another issue when your data gets processed by the app. I'm not too familiar with the Motus network, but as you mentioned, it could just be that their home range extends beyond the stations. It could also be related to location error, compared to the scale of movement, or missing data gaps.

Could you provide me with some more information on both the bat species tracked and how the dataset was collected (including the average location error, number of locations per individual)? Ideally, seeing part of the dataset would also help here so I can troubleshoot what exactly is going wrong. You can email me instead (i.simoes-silva@hzdr.de) if it is easier.

@ecoisilva
Copy link
Owner

Since I've pushed a fix for the initial issues, I will now be closing this.

@ecoisilva ecoisilva added the bug Something isn't working label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants