Learn R Programming

loopevd (version 1.0.2)

raster_fevd: Turn Raster of Annual Maximums into Extreme Value Distributions parameters for Netcdf Output

Description

Turn Raster of Annual Maximums into Extreme Value Distributions parameters for Netcdf Output

Usage

raster_fevd(
  r,
  evd_mod_str,
  nsloc = NULL,
  outfile = NULL,
  cores = 1,
  ntries = 1,
  silent = FALSE,
  seed = NULL
)

Value

the parameters of the evd in a SpatRasterDataset

Arguments

r

SpatRaster

evd_mod_str

either a string "fgumbel", "fgev" or "fgumbelx" from the extreme value distribution (evd) in the evd package

nsloc

A data frame with the same number of rows as the length of x, for linear modelling of the location parameter. The data frame is treated as a covariate matrix (excluding the intercept). A numeric vector can be given as an alternative to a single column data frame.

outfile

filename to write to netcdf

cores

positive integer. If cores > 1, a 'parallel' package cluster with that many cores is created and used. You can also supply a cluster object. Ignored for functions that are implemented by terra in C++ (see under fun)

ntries

The integer number of tries to fit the evd

silent

logical: should the report of error messages be suppressed?

seed

set the seed for fitting.

See Also

evd::fgev(), evd::fgumbelx()

Examples

Run this code
require(terra)
r = rast(system.file("extdata/50km_AnnMax_agcd_v1_tmax_mean_r005_daily_1980-2019.nc"
,package = "loopevd"))
r2 = aggregate(r,4) #lower the resolution for a fast example
gumbel_r = raster_fevd(r2,"fgumbel",seed = 1)
plot(gumbel_r$loc,main = "location")

Run the code above in your browser using DataLab