
Tidy Randomly Generated Generalized Pareto Distribution Tibble
Source:R/random-tidy-general-pareto.R
tidy_generalized_pareto.RdThis function will generate n random points from a generalized
Pareto distribution with a user provided, .shape1, .shape2, .rate or
.scale and number of #' random simulations to be produced.
The function returns a tibble with the simulation number column the x column
which corresponds to the n randomly generated points, the d_, p_ and q_
data points as well.
The data is returned un-grouped.
The columns that are output are:
sim_numberThe current simulation number.xThe current value ofnfor the current simulation.yThe randomly generated data point.dxThexvalue from thestats::density()function.dyTheyvalue from thestats::density()function.pThe values from the resulting p_ function of the distribution family.qThe values from the resulting q_ function of the distribution family.
Usage
tidy_generalized_pareto(
.n = 50,
.shape1 = 1,
.shape2 = 1,
.rate = 1,
.scale = 1/.rate,
.num_sims = 1,
.return_tibble = TRUE
)Arguments
- .n
The number of randomly generated points you want.
- .shape1
Must be positive.
- .shape2
Must be positive.
- .rate
An alternative way to specify the
.scaleargument- .scale
Must be positive.
- .num_sims
The number of randomly generated simulations you want.
- .return_tibble
A logical value indicating whether to return the result as a tibble. Default is TRUE.
Details
This function uses the underlying actuar::rgenpareto(), and its underlying
p, d, and q functions. For more information please see actuar::rgenpareto()
See also
https://openacttexts.github.io/Loss-Data-Analytics/ChapSummaryDistributions.html
Other Continuous Distribution:
tidy_beta(),
tidy_burr(),
tidy_cauchy(),
tidy_chisquare(),
tidy_exponential(),
tidy_f(),
tidy_gamma(),
tidy_generalized_beta(),
tidy_inverse_burr(),
tidy_inverse_exponential(),
tidy_inverse_gamma(),
tidy_inverse_normal(),
tidy_inverse_pareto(),
tidy_inverse_weibull(),
tidy_logistic(),
tidy_lognormal(),
tidy_normal(),
tidy_paralogistic(),
tidy_pareto(),
tidy_pareto1(),
tidy_t(),
tidy_triangular(),
tidy_uniform(),
tidy_weibull(),
tidy_zero_truncated_geometric()
Other Pareto:
tidy_inverse_pareto(),
tidy_pareto(),
tidy_pareto1(),
util_pareto1_aic(),
util_pareto1_param_estimate(),
util_pareto1_stats_tbl(),
util_pareto_param_estimate(),
util_pareto_stats_tbl()
Examples
tidy_generalized_pareto()
#> # A tibble: 50 × 7
#> sim_number x y dx dy p q
#> <fct> <int> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 1 0.348 -2.07 2.12e- 3 0.258 0.348
#> 2 1 2 1.15 3.71 3.82e- 2 0.536 1.15
#> 3 1 3 0.281 9.50 2.24e- 3 0.219 0.281
#> 4 1 4 2.71 15.3 4.41e- 3 0.730 2.71
#> 5 1 5 59.4 21.1 2.39e- 4 0.983 59.4
#> 6 1 6 0.965 26.9 1.03e-17 0.491 0.965
#> 7 1 7 1.85 32.6 7.52e-18 0.649 1.85
#> 8 1 8 0.971 38.4 0 0.493 0.971
#> 9 1 9 2.74 44.2 3.81e-18 0.733 2.74
#> 10 1 10 1.11 50.0 0 0.527 1.11
#> # ℹ 40 more rows