## rsymstb -
xmpBasics("Start: Symmetric Stable Distribuion: > ")
par(mfcol = c(3, 2), cex = 0.5)
set.seed(1953)
r = rsymstb(n = 1000, alpha = 1.85)
plot(r, type = "l", main = "symstb: alpha = 1.85")
# Plot empirical density and compare with true density:
hist(r, n = 25, probability = TRUE, border = "white", col = "steelblue4")
x = seq(-10, 10, 0.1)
lines(x, dsymstb(x = x, alpha = 1.85))
# Plot df and compare with true df:
plot(sort(r), (1:1000/1000), main = "Probability", col = "steelblue4")
lines(x, psymstb(x, alpha = 1.85))
# Compute quantiles:
qsymstb(psymstb(q = seq(-10, 10, 1), alpha = 1.85), alpha = 1.85)
## stable -
set.seed(1953)
r = rstable(n = 1000, alpha = 1.85, beta = 0.3)
plot(r, type = "l", main = "stable: alpha = 1,85 beta = 0.3")
# Plot empirical density and compare with true density:
hist(r, n = 25, probability = TRUE, border = "white", col = "steelblue4")
x = seq(-10, 10, 0.1)
lines(x, dstable(x = x, alpha = 1.85, beta = 0.3))
# Plot df and compare with true df:
plot(sort(r), (1:1000/1000), main = "Probability", col = "steelblue4")
lines(x, pstable(q = x, alpha = 1.85, beta = 0.3))
# Compute quantiles:
qstable(pstable(seq(-10, 10, 1), alpha = 1.85, beta = 0.3),
alpha = 1.85, beta = 0.3)
Run the code above in your browser using DataLab