Forum Numerical Method Statistics
PeaksOverThreshold fitting error
-
mbotta00Participant 2013-09-12 at 11:09 am
Hi, i whant to instance a gdp distribution from a set of observation. When i use the function fit in a PeaksOverThreshold instance diden’t work. I suppose that this method is slow because is computationally very expensive, it’s correct? This is my code: PeaksOverThreshold pot = new eaksOverThreshold(threshold); EstimateByLogLikelihood parameterGDP = pot.fit(observed); double[] paramFittedGDP = prameterGDP.getFittedParameters().toArray(); GDP = new generalizedParetoDistribution(paramFittedGDP[0],paramFittedGDP[1]);
Thanks in advance!
M
-
Ken YiuParticipant 2013-09-16 at 11:06 am
Hi,
Sorry, I don’t have your data to reproduce the issue. How big is your dataset please? However, when I use mine (contains only 50 values) with the following code, the code returns in 0.033s (on my slow PC):
@Test public void test_forum_question() throws Exception { PeaksOverThreshold pot = new PeaksOverThreshold(36.8); EstimateByLogLikelihood parameterGDP = pot.fit(wind); double[] paramFittedGDP = parameterGDP.getFittedParameters().toArray(); System.out.println("gdp param: " + Arrays.toString(paramFittedGDP)); GeneralizedParetoDistribution GDP = new GeneralizedParetoDistribution(paramFittedGDP[0], paramFittedGDP[1]); }For your reference, below is the dataset (wind) I used: 32.98, 69.4, 28.58, 26.89, 38.82, 24.01, 38.09, 34.64, 45.21, 38.96, 36.82, 38.26, 31.57, 27.43, 31.31, 32.54, 30.18, 26.63, 54.75, 27.71, 22.8, 25.55, 38.9, 25.66, 22.64, 23.75, 27.69, 43.66, 42.99, 47.91, 24.04, 31.55, 26.69, 26.88, 35.21, 28.12, 28.88, 33.83, 25.99, 37.23, 27.12, 29.12, 24.74, 25.45, 29.48, 98.16, 29.45, 44.61, 24.24, 33.86,
-
mbotta00Participant 2013-09-17 at 10:06 am
Thanks for the answer. I found the problem, the Threshold was wrong! Best regards.
Matteo