Fit the species
fit_pdfsp(climate, ccs, bin_width, shape, xrange, use_ccs = TRUE)
A vector of climatic values where the species is present.
ccs object returned by
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.
The imposed shape of the species
pdfs. We recommend using
'normal' for temperature variables and 'lognormal' for the
variables that can only take positive values, such as
precipitation or aridity. Default is 'normal' for all.
The climate gradient upon which the
Boolean to indicate if the
pdfsp should be corrected by
the distribution of the modern climate space
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 - xrange)), 1) #>  TRUE