Skip to content

Instantly share code, notes, and snippets.

@StefanThoma
Created June 24, 2022 14:07
Show Gist options
  • Save StefanThoma/d48ee930f601e7492b1217cbbc936eaf to your computer and use it in GitHub Desktop.
Save StefanThoma/d48ee930f601e7492b1217cbbc936eaf to your computer and use it in GitHub Desktop.
f <- function(x) (dchisq(x, 1) + dchisq(x, 2))/2
curve(f, from = 0, to = 10)
pf <- function(x) integrate(f, 0, x)$value
# test
pf(5.14)
quantf <- GoFKernel::inverse(pf, lower = .000001, upper = Inf)
quantf(.95)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment