[R-SIG-Finance] Imaginary root / complex number in a Gamma function

Maheshwari, Dhruv dhruv.maheshwari at blackrock.com
Tue Feb 21 23:56:24 CET 2012

This question is not directly finance-related, and is better suited for R-help.

But to quickly answer your question: see packages fAsianOptions and gsl. cgamma in the former, and you'll need to read the documentation more closely for the latter (try ?gsl::gamma)

- Dhruv

-----Original Message-----
From: r-sig-finance-bounces at r-project.org [mailto:r-sig-finance-bounces at r-project.org] On Behalf Of Mishuk.Chowdhury at tdameritrade.com
Sent: Tuesday, February 21, 2012 17:23
To: r-sig-finance at r-project.org
Subject: [R-SIG-Finance] Imaginary root / complex number in a Gamma function

Hi all,

I am trying to calculate the value of a gamma function with a complex number.

I'm getting this error:

> testfunc = function(d,z)
+ {
+   gamma(complex(real = d, imaginary = z)) }
> testfunc(1,2)

Error in gamma(complex(real = d, imaginary = z)) :
  unimplemented complex function

Is there a package that allows complex numbers within Gamma functions? Any other alternatives?



	[[alternative HTML version deleted]]

R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.

THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE PRIVILEGED.  If this message was misdirected, BlackRock, Inc. and its subsidiaries, ("BlackRock") does not waive any confidentiality or privilege.  If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone.  Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.  The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BlackRock, unless the author is authorized by BlackRock to express such views or opinions on its behalf.  All email sent to or from this address is subject to electronic storage and review by BlackRock.  Although BlackRock operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.

More information about the R-SIG-Finance mailing list