plot_density: Density Comparison Plot

Description Usage Arguments Value Examples

View source: R/diagnostics.R

Description

Density Comparison Plot

Usage

1
plot_density(x, fits, nbins)

Arguments

x

numeric vector of sample data

fits

a list object produced from fit_univariate, fit_empirical, or fit_univariate_man

nbins

number of bins for histogram

Value

ggplot of empirical histogram of x compared to theoretical density distributions

Examples

1
2
3
4
5
6
7
library(ggplot2)
set.seed(37)
x <- rgamma(10000, 5)
dists <- c('gamma', 'lnorm', 'weibull')
fits <- lapply(dists, fit_univariate, x = x)
plot_density(x, fits, 30) +
theme_bw()

fitur documentation built on May 2, 2019, 6:37 a.m.