# Set alpha, beta, sigma and mu stable parameters in a vector
pars <- c(1.5, 0.9, 1, 0)
# Generate an abscissas axis and probabilities vector
x <- seq(-5, 10, 0.05)
p <- seq(0.01, 0.99, 0.01)
# Calculate pdf, cdf and quantiles
pdf <- stable_pdf(x, pars)
cdf <- stable_cdf(x, pars)
xq <- stable_q(p, pars)
# Generate random values
set.seed(1)
rnd <- stable_rnd(100, pars)
head(rnd)
# Estimate the parameters of the skew stable distribution given
# the generated sample:
# Using the McCulloch's estimator:
pars_init <- stable_fit_init(rnd)
# Using the Koutrouvelis' estimator, with McCulloch estimation
# as a starting point:
pars_est_K <- stable_fit_koutrouvelis(rnd, pars_init)
# Using maximum likelihood estimator:
pars_est_ML <- stable_fit_mle(rnd, pars_est_K)
# Using modified maximum likelihood estimator (see [1]):
pars_est_ML2 <- stable_fit_mle2d(rnd, pars_est_K)
Run the code above in your browser using DataLab