ADMB Documentation  11.1.2246
 All Classes Files Functions Variables Typedefs Friends Defines
vinvcumdt.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: vinvcumdt.cpp 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <admodel.h>
00012 
00017 dvariable inv_cumd_t(const prevariable& n,const prevariable&  u,double eps)
00018 {
00019   double sgn;
00020   dvariable v;
00021   if (u<0.5)
00022   {
00023     v=2.0*u;
00024     sgn=-1.0;
00025   }
00026   else
00027   {
00028     v=2.0*(1.0-u);
00029     sgn=1.0;
00030   }
00031   dvariable pfive=0.5;
00032   dvariable w=inv_cumd_beta_stable(0.5*n,pfive,v,eps);
00033   return sgn*sqrt(n*(1.0/w-1.0));
00034 }