Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a function, whose domain is [0,1]. The function is

f = Piecewise[{{Exp[-β * (-Log[#])^α], 0 < # <= 1}}, #]&

with β > 0 and α > 0

(side note: is this the best way of defining the function such that it's Exp[-β * (-Log[#])^α] on (0,1] and 0 at 0?)

I would now like to use the inverse of this function, which I'm pretty sure exists (and is E^(-(-1)^((1/α)) β^(-1/α) Log[w]^(1/α))). However,

InverseFunction[f]

simply returns the call and not the actual inverse.

At this point I'm not sure whether it's my lousy Mathematica skills that keep me from getting the correct inverse or whether there's something in the math that I've neglected to consider. What am I doing wrong? How do I tell Mathematica to just find the inverse on [0,1] and how do I tell it that both parameters are positive?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

In this case, I would restrict the domain of the inverse after inverting it, as follows

invf = InverseFunction[Exp[-β (-Log[#])^α] &]
(* E^(-(-1)^((1/α)) β^(-1/α) Log[#1]^(1/α))& *)

Piecewise[{{E^(-(-1)^((1/α)) β^(-1/α) Log[#1]^(1/α)), 0 < # <= 1}}, #]&

or, a little more programmatically

With[{f = invf[[1]], Piecewise[{{f, 0 < # <= 1}}, #]&]

where the With gets around the HoldAll attribute of Function. Although, this works, too:

Piecewise[{{invf[#], 0 < # <= 1}}, #]&
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.