raster_fevd: Turn Raster of Annual Maximums into Extreme Value...

View source: R/loopFuns.R

raster_fevdR Documentation

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
)

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

integer number of attempts at fitting fgumbelx

silent

logical: should the report of error messages be suppressed?

seed

set the seed for fitting.

Value

the parameters of the evd in a SpatRasterDataset

See Also

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

Examples

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")

loopevd documentation built on June 23, 2025, 5:09 p.m.