Hello everyone,
I have a task to determine which distribution corresponds to the probability density function constructed from my data.
To address this, I use the KS-test for distributions that I consider somewhat similar to my own.
However, when applying the fit
to several distributions, I encounter the following error:
ERROR: suffstats is not implemented for (GeneralizedPareto, Vector{Float64}).
Could you advise how to fix this error? Or should I approach my problem differently from the beginning?
Code:
using JLD2, Distributions, HypothesisTests, Statistics
function get_PDF(IEI; shift = 10)
total_count_IEI = length(IEI)
array_PDF = Float64[]
for index in 1:total_count_IEI
count_IEI_i = count(IEI[index]-shift .<= IEI .<= IEI[index]+shift)
PDF_IEI_i = count_IEI_i / total_count_IEI
push!(array_PDF, PDF_IEI_i)
end
return array_PDF
end
path_to_save_PDF = "/home/sergey/work/data/3Rulkov_chemical/EEs/"
name_PDF = "PDFok g1 = 4.7; g2 = 5.0.jld2"
name_thresholds = "ampl_spikes g1 = 4.7; g2 = 5.0.jld2"
PDF_EEs = load(path_to_save_PDF*name_PDF)["PDF_ok"]
ampl_spikes = load(path_to_save_PDF*name_thresholds)["ampl_spikes"]
data = abs.(ampl_spikes);
data = sort(data);
PDF_positive_spikes = get_PDF(data; shift = 0.03)
weibull_dst = fit(Weibull, data)
expon_dst = fit(Exponential, data)
noncent_dst = fit(GeneralizedPareto, data) # error
fit(NoncentralChisq, data) # error
ks_test_weib = ExactOneSampleKSTest(data, weibull_dst)
ks_test_exp = ExactOneSampleKSTest(data, expon_dst)
Link to the data: data for KS-test - Google Drive
Thanks for your help!
PDF for my data: