params_spei: Calculation of the parameters of a selected probability...

View source: R/SPI_SPEI_at_specific_day.R

params_speiR Documentation

Calculation of the parameters of a selected probability distribution for a selected day (SPEI).

Description

Calculation of the parameters of a selected probability distribution for a selected day (SPEI).

Usage

params_spei(
  Prod_data,
  trgt = NULL,
  ref_start = NULL,
  ref_end = NULL,
  distribution = "log-Logistic",
  fit = "ub-pwm",
  package = "SCI"
)

Arguments

Prod_data

'SpatRaster' object that contains spatially-distributed monthly data for a specific date (e.g., " This object contains the daily accumulated values of a specific day according to the scale provided. This object can be computed with the 'spi_agregate_daily' function. This 'SpatRaster' must only contain the days that corresponds to the specific selection.

trgt

The day for which the function will be computed. The default is NULL, indicating that the last day of the data will be used to return the SPI values.

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'.

package

Either 'SCI' or 'SPEI'. Should the SCI or SPEI package be used in the implementation?

Value

This function returns the fit parameters of the selected distribution according to a selected day. The input object 'Prod_data' has to be created before, which can be achieved with the 'spi.agregate_daily' function.


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