A point process over exceedances of a threshold, combining an arrival rate with a magnitude distribution.
Usage
model_point_process(
data,
threshold = NULL,
total_years = NULL,
use_defaults = TRUE,
seasonal = FALSE,
time_block = c("water_year", "calendar_year", "custom_year", "quarter", "month"),
start_month = 10,
parameters = NULL,
parameter_values = NULL,
use_default_flat_priors = NULL
)Arguments
- data
a numeric vector of observations, or an
analysis_data()frame.- threshold
optional exceedance threshold; derived from the data when omitted. See
threshold_diagnostics()for choosing one.- total_years
optional record length in years, used for the arrival rate.
- use_defaults
logical; let the model derive its threshold and record length from the data. Applied before an explicit
thresholdortotal_years, so an explicit value wins.- seasonal
logical; fit two seasonal magnitude distributions with fitted change points.
- time_block
the block a seasonal model reduces the record over:
"water_year"(the default),"calendar_year","custom_year","quarter"or"month".- start_month
the month a water year or custom year begins. Default 10 (October).
- parameters
optional
model_parameter()object or list of them, setting bounds, fixed flags, priors, or starting values.- parameter_values
optional numeric vector of all parameter values, applied last.
- use_default_flat_priors
logical; set
FALSEalongside a custom prior.
Details
With seasonal = TRUE the magnitude distribution becomes TWO generalized extreme value
marginals with two fitted change points, and each observation is assigned to a season by its
day of the year – so the data must carry DATES rather than bare indices:
data <- analysis_data(exact = list(date = dates, value = peaks))
model <- model_point_process(data, seasonal = TRUE)Observations supplied with integer indices are treated as January 1 of that year, which puts every one of them in the same season.
Examples
x <- c(1200, 1500, 890, 2210, 1870, 1420, 980, 2850, 1740, 1160, 1920, 1380, 2560, 1050)
model_point_process(x, threshold = 1000, total_years = 14)
#> <corehydro_model> point_process
#> data: 14 exact observations