View source: R/mod_fit_pdfsp.R
fit_pdfsp | R Documentation |
pdfs
.Fit the species pdfs
.
fit_pdfsp(
climate,
ccs,
bin_width,
shape,
xrange,
use_ccs = TRUE,
climateSpaceWeighting.type = "linear"
)
climate |
A vector of climatic values where the species is present. |
ccs |
A |
bin_width |
The width of the bins used to correct for unbalanced climate state. Use values that split the studied climate gradient in 15-25 classes (e.g. 2°C for temperature variables). Default is 1. |
shape |
The imposed shape of the species |
xrange |
The climate gradient upon which the |
use_ccs |
Boolean to indicate if the |
climateSpaceWeighting.type |
A correction factor for the clame space weighting correction to limit the edge effects. Either 'linear' (default), 'sqrt' or 'log'. |
The pdf of the species.
# Creating one randomised species
climate_species <- round(stats::rnorm(50, 15, 2), 1)
# Creating one randomised climate space
climate_space <- base::sample(0:300 / 10, 4000, replace = TRUE)
ccs <- calib_clim_space(climate_space, 2)
xrange <- fit_xrange(ccs, "normal", 2)
pdfsp <- fit_pdfsp(climate_species, ccs, 2, "normal", xrange)
plot(xrange, pdfsp, type = "l")
# Testing that the area under the curve is equal to 1.
all.equal(sum(pdfsp * (xrange[2] - xrange[1])), 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.