dot-get_params.sci: Utils function to calculate the parameters of the selected...

.get_params.sciR Documentation

Utils function to calculate the parameters of the selected distribution function for the SPI or SPEI using a vector. This function is based on the code presented in the SCI package obtained from https://github.com/cran/SCI/blob/master/R/sci.r

Description

Utils function to calculate the parameters of the selected distribution function for the SPI or SPEI using a vector. This function is based on the code presented in the SCI package obtained from https://github.com/cran/SCI/blob/master/R/sci.r

Usage

.get_params.sci(x, trgt, dates, ref_start, ref_end, distribution, fit, params)

Arguments

x

Numerical vector.

trgt

The day for which the function will be computed. The default is NULL, indicating that the last day of the data will be selected.

dates

Vector of dates that is extracted from the 'SpatRaster' in the 'spatial_spei' function.

ref_start

optional value that represents the starting point of the reference period used for computing the index. The date should be introduced as '%Y-%m'. For example: "1989-02". The default is NULL, which indicates that the first layer in the 'SpatRaster' will be used as starting point.

ref_end

Optional value that represents the ending point of the reference period used for computing the index. The date should be introduced as '%Y-%m'. For example: "1989-02". The default is NULL, which indicates that the last layer in the 'SpatRaster' will be used as ending point.

distribution

Optional value indicating the name of the distribution function to be used for computing the SPI (one of 'log-Logistic', 'Gamma' and 'PearsonIII'). Defaults to 'log-Logistic' for SPEI.

fit

Optional value indicating the name of the method used for computing the distribution function parameters (one of 'ub-pwm', 'pp-pwm' and 'max-lik'). Defaults to 'ub-pwm'.

params

Should the parameters of the selected distributions be returned? Set to FALSE as the default.


obaezvil/SpatIndex documentation built on Aug. 9, 2024, 3:42 p.m.