Skip to contents

Generates a plot showing probability densities of a nonstationary model for selected time slices (left panel) and the data (right panel).

Usage

plot_nsffa_fit(
  results,
  slices = c(1925, 1950, 1975, 2000),
  show_line = TRUE,
  ...
)

Arguments

results

A fitted flood frequency model generated by fit_lmoments(), fit_mle() or fit_gmle().

slices

Years at which to plot the nonstationary probability model.

show_line

If TRUE (default), draw a fitted line through the data.

...

Optional named arguments: 'title', 'xlabel', and 'ylabel'.

Value

ggplot; a plot showing:

  • The likelihood function of the distribution plotted vertically on the left panel.

  • The data, connected with a line if show_line == TRUE, on the right panel.

Examples

data <- rnorm(n = 100, mean = 100, sd = 10) + seq(1, 100)
years <- seq(from = 1901, to = 2000)
ns_structure <- list(location = TRUE, scale = FALSE)

results <- fit_mle(
     data, 
     "GEV", 
     ns_years = years, 
     ns_structure = ns_structure
)

plot_nsffa_fit(results)