4
$\begingroup$

Any Idea why I can't get a result from this expression:

In[170]:= RandomVariate[HyperbolicDistribution[59.428`, 18.441`, 3.428`*^-9, -0.00065`]]

Out[170]= RandomVariate[HyperbolicDistribution[59.428, 18.441, 3.428*10^-9, -0.00065]]

I have found this distribution in modelling the daily balance of a bank in order to calculate liquidity risk.

$\endgroup$
  • $\begingroup$ Apparently 3.428 10^-9 is too small. 3.428 10^-7 works OK, though $\endgroup$ – Dr. belisarius Apr 21 '14 at 17:27
  • $\begingroup$ It doesn't look like the impact of the third parameter is really large at the given value. The plot of the PDF remains visually unchanged if you increase it by a factor of 1000. $\endgroup$ – Sjoerd C. de Vries Apr 21 '14 at 21:25
  • $\begingroup$ Sjoerd raised a good point: Increasing delta by a factor of 100 still gives results that match to 7+ decimal places. Doing so allows use of RandomVariate. $\endgroup$ – ciao Apr 21 '14 at 21:41
5
$\begingroup$

Looks like a glitch, however you can invert the CDF to get the desired result (not as fast, of course):

InverseCDF[HyperbolicDistribution[1, 59.428`, 18.441`, 3.428`*^-9, -0.00065`], 
            RandomReal[1, 10]]

(* {0.000448962, 0.0144836, 0.0481936, -0.0169342, 0.0445246, -0.0151702, 0.00316436, 0.00877931, 0.085059, 0.00880039} *)
$\endgroup$
  • $\begingroup$ Many thanks mate! $\endgroup$ – user13852 Apr 22 '14 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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