Authors: Florian Kobierska Baffie [aut, cre]
Version: 0.1
License: MIT
This package was developed for the FlomKart project. It contains functions to fit probability distributions to flood data. The following distributions are implemented: - Generalized extreme value (gev) - Generalized logistics (gl) - Gumbel (gumbel) - Gamma (gamma) - Pearson III (pearson) Four parameter estimation methods are available: - Maximum likelihood (mle) - Linear moments (Lmom) - Ordinary moments (mom) - Bayesian inference (bayes) All functions are named distr_method (i.e. gl_bayes)
evd, ismev, pracma, nsRFA, MASS, fitdistrplus, plyr
testthat, packagedocs
Function to fit the gamma distribution with BayesianMCMC method
gamma_bayes(dat)
library(FlomKartShinyApp)
estimate = gamma_bayes(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 5)
## Warning in max(na.omit(y)): no non-missing arguments to max; returning -Inf
Function to fit the gamma distribution with the linear moment method
gamma_Lmom(dat)
library(FlomKartShinyApp)
estimate = gamma_Lmom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 2)
Function to fit the gamma distribution with the maximum likelihood method
gamma_mle(dat)
library(FlomKartShinyApp)
estimate = gamma_mle(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 2)
Function to fit the gamma distribution with the ordinary moments method
gamma_mom(dat)
library(FlomKartShinyApp)
estimate = gamma_mom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 2)
Function to calculate the posterior predictive distribution after calling gev_bayes
get_posterior_gev(mmrp, mupars, spars, kpars)
Function to calculate the posterior predictive distribution after calling gev_bayes
get_posterior_gl(mmrp, mupars, spars, kpars)
Function to calculate the posterior predictive distribution after calling gumbel_bayes
get_posterior_gumbel(mmrp, mupars, spars)
Function to calculate the posterior predictive distribution after calling pearson_bayes
get_posterior_PEARSON(mmrp, mupars, spars, kpars)
Function to fit the GEV distribution with BayesianMCMC method WE assume that the shape parameter only has a prior with mean zero and standard deviation 0.2 (dnorm(x[3], 0, 0.2))
gev_bayes(dat)
library(FlomKartShinyApp)
estimate = gev_bayes(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 3)
Function to fit the GEV distribution with the linear moment method
gev_Lmom(dat)
library(FlomKartShinyApp)
estimate = gev_Lmom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 3)
Function to fit the GEV distribution with the maximum likelihood method
gev_mle(dat)
library(FlomKartShinyApp)
estimate = gev_mle(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 3)
Function to fit the GEV distribution with the ordinary moments method
gev_mom(dat)
library(FlomKartShinyApp)
estimate = gev_mom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 3)
Function to fit the Generalized Logistics distribution with BayesianMCMC method We assume that the shape parameter only has a prior with mean zero and standard deviation 0.2 (dnorm(x[3], 0, 0.2))
gl_bayes(dat)
library(FlomKartShinyApp)
estimate = gl_bayes(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 4)
## Warning in log(1 - k * (x - xi)/alfa): NaNs produced
Function to fit the Generalized Logistics distribution with the linear moments method
gl_Lmom(dat)
library(FlomKartShinyApp)
estimate = gl_Lmom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 4)
## Warning in log(1 - k * (x - xi)/alfa): NaNs produced
Function to fit the GL distribution with the maximum likelihood method. This function was copied from Kolbjorn’s initial file
gl_mle(xdat, ydat = NULL, mul = NULL, sigl = NULL, shl = NULL, mulink = identity, siglink = identity, shlink = identity, muinit = NULL, siginit = NULL, shinit = NULL, show = FALSE, method = "Nelder-Mead", maxit = 10000, ...)
library(FlomKartShinyApp)
estimate = gl_mle(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 4)
## Warning in log(1 - k * (x - xi)/alfa): NaNs produced
Function to fit the Generalized Logistics distribution with the ordinary moments method
gl_mom(dat)
library(FlomKartShinyApp)
estimate = gl_mom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 4)
Function to fit the Gumbel distribution with BayesianMCMC method We do not provide a prior for the BayesianMCMC function
gumbel_bayes(dat)
library(FlomKartShinyApp)
estimate = gumbel_bayes(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 1)
Function to fit the Gumbel distribution with the linear moment method
gumbel_Lmom(dat)
library(FlomKartShinyApp)
estimate = gumbel_Lmom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 1)
Function to fit the Gumbel distribution with the maximum likelihood method
gumbel_mle(dat)
library(FlomKartShinyApp)
estimate = gumbel_mle(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 1)
Function to fit the Gumbel distribution with the ordinary moments method
gumbel_mom(dat)
library(FlomKartShinyApp)
estimate = gumbel_mom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 1)
Function to fit the pearson distribution with BayesianMCMC method WE assume that the shape parameter only has a prior with mean zero and standard deviation 0.2 (dnorm(x[3], 0, 0.2))
pearson_bayes(dat)
library(FlomKartShinyApp)
estimate = pearson_bayes(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 5)
Function to fit the pearson distribution with the linear moment method
pearson_Lmom(dat)
library(FlomKartShinyApp)
estimate = pearson_Lmom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 5)
Function to fit the pearson distribution with the maximum likelihood method
pearson_mle(dat)
library(FlomKartShinyApp)
estimate = pearson_mle(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 5)
Function to fit the pearson distribution with the ordinary moments method
pearson_mom(dat)
library(FlomKartShinyApp)
estimate = pearson_mom(test_data)
FlomKartShinyApp::plot4server(test_data, param = estimate$estimate, distr = 5)