Post Reply 
cas/xcas implementation of Geometric PDF
05-10-2021, 06:23 PM
Post: #2
RE: cas/xcas implementation of Geometric PDF
Code:

  // geometric_cdf(p,k)=1-(1-p)^k
...
  // k=geometric_icdf(p,P) if 1-(1-p)^k>=P hence 
  gen geometric_icdf(const gen & p,const gen & P,GIAC_CONTEXT){
    return _ceil(ln(1-P,contextptr)/ln(1-p,contextptr),contextptr);
  }
There is no check on k being an integer for geometric_cdf since it's not necessary to compute the expression.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: cas/xcas implementation of Geometric PDF - parisse - 05-10-2021 06:23 PM



User(s) browsing this thread: 1 Guest(s)