This vignette will introduce you to find the critical value for comparison of observed and expected obtained last step.
Simulate_DistK
and Simulate_DistX
simulate bundles of expected distributions for number of heterozygous loci and number of shared alleles respectively.
Dist_SimuChisq
generates a bundle of chi-square values which can be distributed. ecdf
build the cumulative probability functions for the chi-square values.