raster_se_sig: Calculate One-Sided Confidence Level (%)

View source: R/loopFuns.R

raster_se_sigR Documentation

Calculate One-Sided Confidence Level (%)

Description

Computes the one-sided confidence level, defined as (1 - p-value) x 100, for testing whether each mean (mu) differs from zero under a normal approximation.

Usage

raster_se_sig(muvari)

Arguments

muvari

SpatRaster, of mean (location) values, variances corresponding to each mu to test against zero.

Details

For each element:

  1. Calculate the standard error: se = sqrt(vari).

  2. Compute the absolute z-score: z = abs(mu / se).

  3. The one-sided p-value is 1 - phi(z), where phi is the CDF of the standard normal.

  4. The confidence level is (1 - p-value) x 100 = phi(z) x 100.

Value

A SpatRaster of confidence levels (0-100%), each rounded to one decimal place.

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
gev_r = raster_fevd(r2,"fgev")
raster_se_sig(c(gev_r$shape,gev_r$cov_9))

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