0

I'm trying to fit a power law distribution to some sample data. I am trying to find xmin using the estimate_xmin() function. Does anyone know why I get an error about attempting to apply a non-function?

abs.logreturns <- as.data.frame(t(abs.logreturns))
x <- abs.logreturns
estimate_xmin(x, xmins = NULL, pars = NULL, xmax = 1e+05, distance = "ks") 

Error message:

Error in m$getDat() : attempt to apply non-function
jay.sf
  • 60,139
  • 8
  • 53
  • 110
  • 1
    Hi, you need to make your question [reproducible](https://stackoverflow.com/a/5963610/6574038) for Stack Overflow, cheers. – jay.sf Jul 27 '19 at 06:07

1 Answers1

0

You can't pass a vector to the estimate_xmin() - it needs to be a powerlaw object. See the Getting Started and/or Worked examples vignettes in the poweRlaw package - https://github.com/csgillespie/poweRlaw

csgillespie
  • 59,189
  • 14
  • 150
  • 185