BiologicalRecordsCentre / sparta

Species Presence/Absence R Trends Analyses
http://biologicalrecordscentre.github.io/sparta/index.html
MIT License
21 stars 24 forks source link

Vignette is out of date #188

Closed AugustT closed 2 weeks ago

AugustT commented 4 years ago

Thoughts from Angus Jackson. Mostly highlighting that the vignette is getting pretty out of date!

I hope that you are the correct person to direct this enquiry to, but if you have a minute, I have a few questions. I am trying the implement the SPARTA routines on a chunk of citizen science data from marine benthic habitats. I have been working through the very helpful vignette and there are a couple of points where my output differs to that given.

I have identical mock data to that from the vignette (same seed, etc). When calculating the telfer index, I get some additional warning messages to those shown in the vignette – something to do with duplicated column names (see console extract attached). The output from head(telfer_results) is also slightly different. The values for the pairwise comparison are identical, but there are also counts (?) for each taxon at each site, that don’t appear in the vignette.

i) Are the warnings about column names important? ii) Is inclusion of counts just a reflection of an update to sparta that was made after the vignette was written?

Similarly when running the reportingrateModel, the outputs are identical, but additional warnings about boundary fit are present that weren’t shown in the vignette e.g. Modelling e - Species 1 of 7 boundary (singular) fit: see ?isSingular

(I enjoyed the choice of ‘eurotas’ species used in the function!) I have checked out ?isSingular which explains that model parameters are at the limit of feasible values and that in these cases models may be overfitted and less powerful). What is less clear is how much these warnings are of consequence and what may be done with them. I suppose this could be a consequence of using simulated data, but I would imagine that the opposite (real, noisy data) would be more likely to generate this problem. iii) Might you have any thoughts or insights about these warnings? If the issue is with overfitting, would a smaller number of time periods help?

The worked example for WSS again gives the same output to the vignette, except for a string of warnings about boundary (singular) fit:

Finally, I can’t get the occDetModel function to work at all (see below). I can’t find any difference between my code and that used in the vignette. (I’m not excluding the chance of me using useless ‘man eyes’, but everything does seem to match). Any suggestions about why time_period is an unused argument?

system.time({

  • occ_out <- occDetModel(taxa = myData$taxa,
  • site = myData$site,
  • time_period = myData$time_period,
  • species_list = c('a','b','c','d'),
  • write_results = FALSE,
  • n_iterations = 200,
  • burnin = 15,
  • n_chains = 3,
  • thinning = 3,
  • seed = 123)
  • }) Error in occDetModel(taxa = myData$taxa, site = myData$site, time_period = myData$time_period, : unused argument (time_period = myData$time_period) Timing stopped at: 0 0 0

My apologies if you have had these queries before, but they might keep me on the right track when I apply the models to my data and assist with making decisions about restrictions for suitable subsets (limited by number of time periods, list lengths, number of records per site, etc.)

drnickisaac commented 3 years ago

Some further comments from Juha Poyry: " I feel that the vignette could be developed further by including some advice how to proceed after fitting the basic occupancy model, e.g. how to access the species trend estimates, and what might be the next steps when deriving indicators presented on the recent papers by your team. Also some tools for exporting the main results would be helpful (e.g. in case one would like to draw figures in another software). The basic documentation was already at a good level, only under the occupancy models the argument time_period = myData$time_period was outdated, but the current argument (i.e. survey = myData$time_period) could be found in the R help documentation. In addition, there were some typos, but nothing too serious. I can collect a list of these to a separate email if you wish."

simonrolph commented 2 years ago

Also, the images don't load: image

In chrome console

image