difficulties with getprecip() function

18 views
Skip to first unread message

kmancuso88

unread,
Jun 26, 2021, 3:23:11 PM6/26/21
to IsoriX
Hi Alexandre,

My name is Kristen and my project involves looking at stable hydrogen isotopes in Yellow-breasted Chat feathers in North America (primarily western North America). I am using your package to create and calibrate an isoscape based on precipitation. I am using version 0.8.2 of IsoriX and I am having difficulties with the getprecip and prepcipitate functions. When I try to use the getprecip function I get the error:

Error in utils::download.file(address, destfile = complete_path, mode = "wb") : cannot open URL 'http://biogeo.ucdavis.edu/data/worldclim/v2.0/tif/base/wc2.0_30s_prec.zip'
 
I think it is because that link doesn't work anymore since it has been updated to version 2.1:


Regardless, I tried downloading the data manually and unzipping and moving forward with the prepcipitate function, but then I get the following error that I can't seem to get past:

Error in prepcipitate(path = NULL, raster = ElevNA, verbose = interactive()) : There is no *.tif file in path... you may have the path wrong or you may not have downloaded the file using 'getprecip()'.

The .tif files are in the specified path, so I am guessing it has something to do with me downloading the data on my own instead of using the getprecip function? Any advice would be greatly appreciated.

On a related note, is there anyway to get an R-square value from the calibrated isoscape model in order to compare the fit between different models? A reviewer on my mansucript asked for the metric specifically and I don't see a way to calculate it within IsoriX.

Thanks for your time and I look forward to hearing from you,

Kristen Mancuso

Alexandre Courtiol

unread,
Jun 26, 2021, 4:08:54 PM6/26/21
to iso...@googlegroups.com
Hi Kirsten,

Thanks for the info about the outdated link.
This should now be fixed in the devel version of IsoriX which you can install using remotes::install_github("courtiol/IsoriX/IsoriX")
For this to work, you may have to install the package remotes if it is not on your system: install.packages("remotes").
Please let me know if that works or not for you.

About the R2:
The calibration model fitted in IsoriX is a complex kind of errors-in-variables model.
Indeed, when fitting the calibration curve we account for both the error measurements in the sample but also for the uncertainty of the isoscape.
This is why we don't provide an R2: under such a model, the R2 metric does not reflect the quality of the fit and should not be used to compare models.
An intuitive way to understand that is to think that the fit doesn't try to maximise the relationship between predictions and observations because observations associated with locations where the isotopic values vary a lot are less important to get a good calibration than locations where the isotopic values vary less.

What would make more sense to compare models would be to perform cross validation but since calibration models are usually slow to fit, that would take forever...

IMO, reviewers asking for R2 are often reviewers that do not understand statistics very well.
They want a R2 because they are used to the metric but they don't quite understand what it means beyond paroting "it is the part of the variance in prediction explained by the model".
Nor do they know when it makes sense to compute such a metric and when it does not.
Anyhow don't tell them that ;-), but perhaps explain that the models fitted in IsoriX are not simple linear regression for which the R2 has been developed.

Thanks for using IsoriX!


--
You received this message because you are subscribed to the Google Groups "IsoriX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isorix+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isorix/30c096ca-2968-4676-9b91-7187a5da8980n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages