# dk_test: Statistical test to identify dragon kings (DKs) In dragonking: Statistical Tools to Identify Dragon Kings

## Description

`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`.

## Usage

 `1` ```dk_test(vals, r) ```

## Arguments

 `vals` numeric vector with at least 3 elements `r` integer indicating number of DKs in `vals`

## Value

DK test statistic and p-value (F distribution)

## References

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>

## Examples

 ``` 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"])) ```

### Example output

```[1] "Test statistic = 6.15220841506099"
[1] "p-value = 6.13242822418851e-06"
```

dragonking documentation built on May 2, 2019, 4:21 a.m.