Closed phisanti closed 5 years ago
This
x <- table(x)
estimate_xmin(displ$new(x))
is wrong. What you are actually doing is
x <- table(x)
(y = as.vector(x))
length(y)
estimate_xmin(displ$new(y))
i.e. you are passing the frequencies as your data.
Regarding zeros, the discrete power-law isn't defined at 0. So either remove or remap your data, e.g.
estimate_xmin(displ$new(x[x>0]))
estimate_xmin(displ$new(x + 1))
You now get very similar answers.
I have been trying to fit a power-law distribution that contains 0 as a category. Looking at my data, I have many cases with no peaks and fewer and fewer cases with increasing peaks. If I try to fit the distribution on the data itself, I am forced to exclude the 0s as I get the message "Error in check_discrete_data(dat): Data should be strictly positive, i.e. no zeros." However, if I count the cases with a different function - see the table below - and input those counts for the fitting, the parameters that the model produces looks nothing like the "raw data" input.
I suppose case 1 and case 3 should look fairly similar, however, the results are completely different. Moreover, case 2 and 3 are more alike than 1 and 3. Hope you can help me to decide which approach is methodologically correct.