0

I'm, trying to apply this solution to find the p-value in an arbitrary distribution defined from data experiments. I have estimated this distribution using the density function in R. Now, I would like to integrate this function to apply the solution proposed by @mpiktas. However, the integrate function requires a function as input, not two vectors x and y with the values that define the function, which is what density provides.

Any idea on how to deal with this numerical integration based on x-y values in R?

Community
  • 1
  • 1
Pythonist
  • 1,937
  • 1
  • 14
  • 25
  • In [this answer](http://stats.stackexchange.com/questions/30141/determine-if-a-heavy-tailed-distributed-process-has-improved-significantly/30148#30148) I implemented a [KDE](http://en.wikipedia.org/wiki/Kernel_density_estimation) using a Gaussian kernel, which coincides with the one produced by `density()` using the default options. You can also find there how to combine it with `integrate()`. Note that the kernel CDF is also implemented using the same bandwidth (therefore, if this is what you need, the integration step is not necessary). –  Nov 23 '12 at 13:05
  • Yes, I'm pretty much interested in how to get this done in R, although I'm open to other statistical approaches to solve my broader problem, which is why I pointed out to the other question to contextualize mine. Anyway I will flag this one to be moved to Stack Overflow. Thanks for the advice. –  Nov 23 '12 at 14:18
  • We'd be happy to show you how to do it, but you need to provide that definition of this distribution using R code. (It may require integration, but that will be determined by how you offer the definiton of hte distribution.) – IRTFM Nov 23 '12 at 16:03

0 Answers0