dk_test {dragonking}R Documentation

Statistical test to identify dragon kings (DKs)


dk_test runs the DK test on the user parameters and returns a test statistic and corresponding p-value to aid in determining whether there is significant support for the existence of r DKs in vals.


dk_test(vals, r)



numeric vector with at least 3 elements


integer indicating number of DKs in vals


DK test statistic and p-value (F distribution)


Wheatley S, Sornette D (2015). Multiple outlier detection in samples with exponential & pareto tails: Redeeming the inward approach & detecting dragon kings. Swiss Finance Institute Research Paper Series No. 15-28. <doi:10.2139/ssrn.2645709>

Pisarenko VF, Sornette D (2012). Robust statistical tests of dragon-kings beyond power law distributions. Eur Phys J Special Topics, 205: 95-115. <doi:10.1140/epjst/e2012-01564-8>


# generate a numeric vector with DKs
temp <- c(rexp(100),   # exponentially distributed RV
          15, 15, 15)  # DK elements

# test for DKs, where r is number of DKs thought to be in temp
results <- dk_test(temp, r = 3)

# print out test statistic (should be large) and p-value (should be small)
print(paste("Test statistic =", results["Test Statistic"]))
print(paste("p-value =", results["p-value"]))

[Package dragonking version 0.1.0 Index]