Set of functions to estimate the performance of various methods for flood frequency analysis

Authors: Florian Kobierska [aut, cre]

Version: 0.1

License: Norgedata (see license.md)

Description

Work for the FlomKart project

Imports

RNetCDF, quadprog, goftest, tidyverse, leaflet, fitdistrib, evd, nsRFA, ismev, fitdistrplus, stats, parallel, foreach, doSNOW

Suggests

doMC, packagedocs

Package Functions

BS4NC

BS4NC

Brier Score. This is implemented according to Equation 1 of the “Cross validation study and verification document”

Usage

BS4NC(dat, threshold, param, distr = "distr")

Arguments

distr
Brier Score. This is implemented according to Equation 1 of the “Cross validation study and verification document”

fillup_gofnc

fillup_gofnc

Function to fill up the gof_nc database

Usage

fillup_gofnc()

fillup_nc

fillup_nc

Function to fill upthe NetCDF database

Usage

fillup_nc(dat = flood_data, nc_path = "output/flood_database.nc")

fit_distr

fit_distr

The function that calls the right fitting function for each distribution and fitting method

Usage

fit_distr(dat, distr = "distr", method = "method")

Arguments

method
The function that calls the right fitting function for each distribution and fitting method

gof_ad

gof_ad

Anderson Darling

Usage

gof_ad(dat, param, distr = "distr", test.stat = TRUE, p.value = FALSE)

gof_cs

gof_cs

Chi Square calculation. Does not work well

Usage

gof_cs(dat, param, distr = "distr")

gof_ks

gof_ks

Kolmogorov Smirnov. Gives results with warnings but this is because some flood data are repeated (for some strange reason)

Usage

gof_ks(dat, param, distr = "distr", test.stat = TRUE, p.value = FALSE)

Arguments

p.value
Kolmogorov Smirnov. Gives results with warnings but this is because some flood data are repeated (for some strange reason)

gof_nt

gof_nt

Function calculating the NT reliability measure TO FINISH

Usage

gof_nt(dat, rperiods.nt, param, distr = "distr")

Arguments

distr
Function calculating the NT reliability measure TO FINISH

load_1sample

load_1sample

Function that returns only 1 sample with k omited values, according to a specific method (random, sorted min and max)

Usage

load_1sample(dat.fulll, k, method = "method")

Arguments

method
Function that returns only 1 sample with k omited values, according to a specific method (random, sorted min and max)

load_samples

load_samples

Usage

load_samples(dat.full, k)

Arguments

k

norway_map

norway_map

Figure: MAP OF NORWAY WITH ALL THE STATIONS. WORKS

Usage

norway_map(dat, station.nb.vect)

Arguments

station.nb.vect
Figure: MAP OF NORWAY WITH ALL THE STATIONS. WORKS

norway_map2

norway_map2

MAP OF NORWA WITH COLOR CHANGING ACCORDING TO THE NUMBER OF DATA.

Usage

norway_map2(dat, station.nb.vect)

Arguments

station.nb.vect
MAP OF NORWA WITH COLOR CHANGING ACCORDING TO THE NUMBER OF DATA.

plot_all

plot_all

This function creates a 2 by 2 plot by calling all common plotting functions It plots for any distribution and method, as well as the distribution parameters and Goodness Of Fit values Returns nothing, saves nothing

Usage

plot_all(dat, GOF.list, param, distr = "distr", method = "method")

Arguments

method
This function creates a 2 by 2 plot by calling all common plotting functions It plots for any distribution and method, as well as the distribution parameters and Goodness Of Fit values Returns nothing, saves nothing

plot_density

plot_density

plot fitted probability density function to estimated empirical pdf Returns nothing, saves nothing

Usage

plot_density(dat, GOF.list, param, distr = "distr")

Arguments

distr
plot fitted probability density function to estimated empirical pdf Returns nothing, saves nothing

plot_ecdf

plot_ecdf

Plot estimated and empirical cumulative distribution function

Usage

plot_ecdf(dat, param, distr = "distr")

Arguments

distr
Plot estimated and empirical cumulative distribution function

Value

Returns nothing, saves nothing

plot_qq

plot_qq

QQ plot of empiricial against modelled

Usage

plot_qq(dat, param, distr = "distr")

Arguments

distr
QQ plot of empiricial against modelled

Value

Returns nothing, saves nothing

plot_rlevel

plot_rlevel

Plot return levels

Usage

plot_rlevel(dat, param, distr = "distr")

Arguments

distr
Plot return levels

Value

Returns nothing, saves nothing

QS4NC

QS4NC

Quantile Score. Only uses dat.sample so the calling script should be sending DAT.SAMPLE! This is implemented according to Equation 2 of the “Cross validation study and verification document”

Usage

QS4NC(dat, r.levels, r.periods)

Arguments

r.periods
Quantile Score. Only uses dat.sample so the calling script should be sending DAT.SAMPLE! This is implemented according to Equation 2 of the “Cross validation study and verification document”

RLEVELS4NC

RLEVELS4NC

Usage

RLEVELS4NC(param.estimate, return.periods, distr = "distr")

Arguments

distr

run_all

run_all

The function to run all distributions and all methods and output csv files of the GOF

Usage

run_all(dat, station.nb.vect, distr = "distr", method = "method")

Arguments

method
The function to run all distributions and all methods and output csv files of the GOF

run_all_ad

run_all_ad

TEST OF RUN ALL FOR AD ONLY

Usage

run_all_ad(dat, station.nb.vect, method = "method")

Arguments

method
TEST OF RUN ALL FOR AD ONLY

run_all_ff

run_all_ff

FF function copied from run_all.r Test of run_all for ff only.

Usage

run_all_ff(dat, station.nb.vect, distr = "distr", method = "method")

Arguments

method
FF function copied from run_all.r Test of run_all for ff only.

run_all_ff2

run_all_ff2

Test of run_all for ff only. TO COMPARE WITH run_all_ff in F4NCE.R!!!

Usage

run_all_ff2(dat, station.nb.vect, distr = "distr", method = "method")

run_all_ks

run_all_ks

Test of run_all for Ks only.

Usage

run_all_ks(dat, station.nb.vect, method = "method")

Arguments

method
Test of run_all for Ks only.

run_all_norm

run_all_norm

The function to run all distributions and all methods and output csv files of the GOF

Usage

run_all_norm(dat, station.nb.vect, distr = "distr", method = "method")

Arguments

method
The function to run all distributions and all methods and output csv files of the GOF

save_coordinates

save_coordinates

This function saves a new csv with the utm coordinates of each station in station.nb.vect

Usage

save_coordinates(dat, station.nb.vect)

Arguments

station.nb.vect
This function saves a new csv with the utm coordinates of each station in station.nb.vect

sdat_load

sdat_load

Loads flood dat for a specific station

Usage

sdat_load(dat, station.nb)

Arguments

station.nb
Loads flood dat for a specific station

sdat_plot

sdat_plot

Function to plot data histogram, pdf, ecdf and qqplot

Usage

sdat_plot(dat)

Arguments

dat
Function to plot data histogram, pdf, ecdf and qqplot