Description Usage Arguments Value References Examples
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
.
1 | dk_test(vals, r)
|
vals |
numeric vector with at least 3 elements |
r |
integer indicating number of DKs in |
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>
1 2 3 4 5 6 7 8 9 10 | # 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"]))
|
[1] "Test statistic = 6.15220841506099"
[1] "p-value = 6.13242822418851e-06"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.