# What does the inverse Function in R calculate? [closed]

  library(GoFKernel)
x<-seq(0,1000,33)
f <- function(x) pbeta(x, shape1=2, shape2=3)
f.inv <- inverse(f,lower=0,upper=1)
f.inv(.5)
[1] 0.3857168


I don't understand the result of the Code.

When I imagine the inverse function of pbeta, then on the $x$-axis are the probabilities and on the $y$-axis are the values from the $x$-variable.

Input f.inv (.5) is equal to the median or isn't it?

So I expected a value from the $x$-variable more exact 495. What is the meaning of the result 0.3857168?

The documentation was not a great help.

• There is no inverse function in R. If you are using a package, you need to specify it. – Roland Mar 2 '17 at 15:55
• Sorry. The package is GoFKernel. – Hark Mar 2 '17 at 15:57
• It is pretty obvious from it's name and the description "Function to calculate the inverse function of a cumulative distribution function." ... – Tim Mar 2 '17 at 16:05
• If there's a statistical question here you need to spell it out. You seem to be confusing the dummy variable x used inside the function f with the vector of integers x: the median of the Beta(2,3) distribution is indeed 0.3857, & the median of those integers is indeed 495, but one has nothing to do with the other & it's not clear why you think it should. – Scortchi - Reinstate Monica Mar 2 '17 at 16:13

> pbeta(0.3857168,shape1=2, shape2=3)

x<-seq(0,1000,33)

is useless, as this x is not used later in the given code. This may indicate a fundamental misunderstanding concerning the expression <- function(x)...