# Inverse of arcsin

So this might be not the smartest question. But I defined this function:

trans.arcsine <- function(x){
asin(sign(x) * sqrt(abs(x)))
}


which I got from here. My question is how to invert it?

Edit: My domain of interest is [0,1], which was not stated in the beginning. @Glen, however, provided a very good answer for [-1,1] as well.

• Is what you're applying the transform to on [-1,1] or [0,1] ... and why are you doing that? I can only think of one half-decent reason to use arcsin square root and it doesn't apply to the [-1,1] case. – Glen_b Feb 6 '14 at 5:13
• I am using it for [0,1], I know arcsin has its problems. I am trying to transform a dependent variable in a multiple linear regression context. – DUWUDA Feb 6 '14 at 5:40
• really sorry for not stating it clearly. Thanks a lot for your complete and very good answer! I will use [-1,1] in the future for sure as well. – DUWUDA Feb 6 '14 at 5:50

Well arcsin, if restricted to its principal value is a function, and an invertible one.

$$y = \arcsin(\mathrm{sgn}(x)\sqrt{|x|})$$

$$x = \mathrm{sgn}(y)\sin^2(y)$$

(the only possibly not-instantly obvious bit is that ${sgn}(y)={sgn}(x)$).

Let's double check we didn't do something idiotic:

 u <- runif(10000,-1,1)
y <- trans.arcsine(u)
x <- sign(y)*sin(y)^2
max(abs(u-x))
 3.330669e-16
pairs(cbind(u,y,x)) seems to be doing what it's supposed to. Here's the function and inverse on the same plot: Turns out the OP doesn't need it on [-1,1], only on the usual [0,1]. For that case it's much simpler:

$$y = \arcsin(\sqrt{x})$$

$$x = \sin^2(y)$$

I'll leave the original one up because someone will need it one day no doubt.

I won't draw the function and inverse, it just looks like the first quadrant of the function I graphed above the dividing line there.