Skip to content

Commit

Permalink
Fixed color scaling between current and future SDM
Browse files Browse the repository at this point in the history
  • Loading branch information
Wrightr1 committed Apr 16, 2024
1 parent d4c3efb commit 060345b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions maxent_outputs/maxent.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<title>Maxent model</title>
<CENTER><H1>Maxent model</H1></CENTER>
<br> This page contains some analysis of the Maxent model result, created Tue Apr 09 19:52:32 UTC 2024 using 'dismo' version 1.3-14 & Maxent version 3.4.3. If you would like to do further analyses, the raw data used here is linked to at the end of this page.<br>
<br> This page contains some analysis of the Maxent model result, created Tue Apr 16 16:37:58 UTC 2024 using 'dismo' version 1.3-14 & Maxent version 3.4.3. If you would like to do further analyses, the raw data used here is linked to at the end of this page.<br>
<br><HR><H2>Analysis of omission/commission</H2>
The following picture shows the omission rate and predicted area as a function of the cumulative threshold. The omission rate is is calculated both on the training presence records, and (if test data are used) on the test records. The omission rate should be close to the predicted omission, because of the definition of the cumulative threshold.
<br><img src="plots/species_omission.png"><br>
Expand All @@ -23,7 +23,7 @@
<a href = "maxentResults.csv">Results for all species modeled in the same Maxent run, with summary statistics and (optionally) jackknife results</a><br>
<br><br>
Regularized training gain is 0.230, training AUC is 0.696, unregularized training gain is 0.282.<br>
Algorithm terminated after 500 iterations (1 seconds).<br>
Algorithm terminated after 500 iterations (0 seconds).<br>
<br>
The follow settings were used during the run:<br>
234 presence records used for training.<br>
Expand Down
21 changes: 10 additions & 11 deletions maxent_outputs/maxent.log
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Tue Apr 09 19:52:31 UTC 2024
Tue Apr 16 16:37:58 UTC 2024
MaxEnt version 3.4.3
Reading file absence
readGrid: max memory 536870912, total allocated 270532608, free 267385128, used 3147480, increment 3147480
readGrid: max memory 536870912, total allocated 270532608, free 104312496, used 166220112, increment 38187728
Reading samples from presence
Read samples: max memory 536870912, total allocated 270532608, free 261093672, used 9438936, increment 6291456
Read samples: max memory 536870912, total allocated 270532608, free 259935680, used 10596928, increment -155623184
Adding samples to background in feature space
Command line used: autorun -e maxent_outputs/absence -o maxent_outputs -s maxent_outputs/presence -z
Command line to repeat: java density.MaxEnt nowarnings noprefixes outputdirectory=maxent_outputs samplesfile=maxent_outputs/presence environmentallayers=maxent_outputs/absence autorun novisible
Expand All @@ -16,20 +16,19 @@ environmentallayers: maxent_outputs/absence
autorun: true
visible: false

getSamples: max memory 536870912, total allocated 270532608, free 253753640, used 16778968, increment 7340032
getSamples: max memory 536870912, total allocated 270532608, free 255741376, used 14791232, increment 4194304
Making features
makeFeatures: max memory 536870912, total allocated 270532608, free 252703608, used 17829000, increment 1050032
makeFeatures: max memory 536870912, total allocated 270532608, free 254165008, used 16367600, increment 1576368
species:
Regularization values: linear/quadratic/product: 0.050, categorical: 0.250, threshold: 1.000, hinge: 0.500
234 samples
Density: max memory 536870912, total allocated 270532608, free 249559336, used 20973272, increment 3144272
linearPredictor: max memory 536870912, total allocated 270532608, free 249559336, used 20973272, increment 0
FeaturedSpace: max memory 536870912, total allocated 270532608, free 249559336, used 20973272, increment 0
Sequential: max memory 536870912, total allocated 270532608, free 249559336, used 20973272, increment 0
Density: max memory 536870912, total allocated 270532608, free 251547072, used 18985536, increment 2617936
linearPredictor: max memory 536870912, total allocated 270532608, free 251547072, used 18985536, increment 0
FeaturedSpace: max memory 536870912, total allocated 270532608, free 251547072, used 18985536, increment 0
Sequential: max memory 536870912, total allocated 270532608, free 251547072, used 18985536, increment 0
Initial loss: 6.077642243349034
500: time = 0.550000 loss = 5.847453
500: time = 0.447000 loss = 5.847453
Resulting gain: 0.2301887690288824
Time since start: 1.201
Projecting...
Writing file maxent_outputs/species.csv
Ending
4 changes: 2 additions & 2 deletions maxent_outputs/species.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<title>Maxent model for species</title>
<CENTER><H1>Maxent model for species</H1></CENTER>
<br> This page contains some analysis of the Maxent model for species, created Tue Apr 09 19:52:32 UTC 2024 using Maxent version 3.4.3. If you would like to do further analyses, the raw data used here is linked to at the end of this page.<br>
<br> This page contains some analysis of the Maxent model for species, created Tue Apr 16 16:37:58 UTC 2024 using Maxent version 3.4.3. If you would like to do further analyses, the raw data used here is linked to at the end of this page.<br>
<br><HR><H2>Analysis of omission/commission</H2>
The following picture shows the omission rate and predicted area as a function of the cumulative threshold. The omission rate is is calculated both on the training presence records, and (if test data are used) on the test records. The omission rate should be close to the predicted omission, because of the definition of the cumulative threshold.
<br><img src="plots/species_omission.png"><br>
Expand All @@ -23,7 +23,7 @@
<a href = "maxentResults.csv">Results for all species modeled in the same Maxent run, with summary statistics and (optionally) jackknife results</a><br>
<br><br>
Regularized training gain is 0.230, training AUC is 0.696, unregularized training gain is 0.282.<br>
Algorithm terminated after 500 iterations (1 seconds).<br>
Algorithm terminated after 500 iterations (0 seconds).<br>
<br>
The follow settings were used during the run:<br>
234 presence records used for training.<br>
Expand Down
Binary file modified output/rhyacotritonCurrentSdm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified output/rhyacotritonFutureSdm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/CurrentSdm.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ ggplot() +
geom_polygon(data = wrld, mapping = aes(x = long, y = lat, group = group),
fill = "grey75") +
geom_raster(data = rhyacotritonPredictDf, aes(x = x, y = y, fill = layer)) +
scale_fill_gradientn(colors = terrain.colors(10, rev = T)) +
coord_fixed(xlim = c(xmin, xmax), ylim = c(ymin, ymax), expand = F) +#expand=F fixes margin
scale_fill_gradientn(colors = c("red", "orange", "yellow", "green"), limits = c(0, 0.85)) +
coord_fixed(xlim = c(xmin, xmax), ylim = c(ymin, ymax), expand = FALSE) +
scale_size_area() +
borders("state") +
borders("world", colour = "black", fill = NA) +
Expand Down
9 changes: 4 additions & 5 deletions src/FutureSdm.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
# More info: https://pcmdi.llnl.gov/CMIP6/

futureClimateRaster <- cmip6_world("CNRM-CM6-1", "585", "2061-2080", var = "bioc", res=2.5, path="data/cmip6")
futureClimateRaster <- rast(futureClimateRaster)

# 7. Prep for the model


names(futureClimateRaster)=names(currentClimRasterStack)


geographicAreaFutureC6 <- crop(futureClimateRaster, extent(currentClimRasterStack))
geographicAreaFutureC6 <- crop(futureClimateRaster, predictExtent)


# 8. Run the future SDM
Expand All @@ -33,13 +33,12 @@ xmin <- min(rhyacotritonFutureSDMDf$x)
ymax <- max(rhyacotritonFutureSDMDf$y)
ymin <- min(rhyacotritonFutureSDMDf$y)


ggplot() +
geom_polygon(data = wrld, mapping = aes(x = long, y = lat, group = group),
fill = "grey75") +
geom_raster(data = rhyacotritonFutureSDMDf, aes(x = x, y = y, fill = maxent)) +
scale_fill_gradientn(colors = terrain.colors(10, rev = T)) +
coord_fixed(xlim = c(xmin, xmax), ylim = c(ymin, ymax), expand = F) +
scale_fill_gradientn(colors = c("red", "orange", "yellow", "green"), limits = c(0, 0.8)) +
coord_fixed(xlim = c(xmin, xmax), ylim = c(ymin, ymax), expand = FALSE) +
scale_size_area() +
borders("state") +
borders("world", colour = "black", fill = NA) +
Expand Down

0 comments on commit 060345b

Please sign in to comment.