Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e852969
commit 88ccb3b
Showing
8 changed files
with
192 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
Package: NORMT3 | ||
Title: Evaluates complex erf, erfc and density of sum of Gaussian and Student's t | ||
Version: 1.0-1 | ||
Date: 209-02-137 | ||
Title: Evaluates complex erf, erfc, Faddeeva, and density of sum of | ||
Gaussian and Student's t | ||
Version: 1.0-2 | ||
Date: 17/03/2010 | ||
Author: Guy Nason <g.p.nason@bristol.ac.uk> | ||
Maintainer: Guy Nason <g.p.nason@bristol.ac.uk> | ||
Description: Evaluates the probability density function of the sum of the | ||
Gaussian and Student's t density on 3 degrees of freedom. | ||
Evaluates the p.d.f. of the sphered Student's t density function. | ||
Also evaluates the erf and erfc functions on complex-valued arguments. | ||
License: GPL (>= 2) | ||
Packaged: Fri Feb 13 14:50:55 2009; ripley | ||
Depends: R (>= 2.0) | ||
Description: Evaluates the probability density function of the sum of | ||
the Gaussian and Student's t density on 3 degrees of freedom. | ||
Evaluates the p.d.f. of the sphered Student's t density | ||
function. Also evaluates the erf, and erfc functions on | ||
complex-valued arguments. Thanks to Krishna Myneni the function | ||
is calculates the Faddeeva function also! | ||
License: GPL-2 | ||
Packaged: 2012-10-29 08:57:20 UTC; ripley | ||
Repository: CRAN | ||
Date/Publication: 2012-10-29 08:57:20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
fd5fe172ef3ae16f4cc83501ea3215dd *DESCRIPTION | ||
9fdfeb11f7ddba6f3aab9aaa6b1ac5dd *NAMESPACE | ||
adef3a419005deb8c91bade7964cb31c *R/dnormt3.R | ||
dce3e8bb5f353fda3d700bdba01f4651 *R/dst.R | ||
33717d45906e412719aa2035088377f4 *R/erf.R | ||
2b2c7491f277ea56529f7dc734267509 *R/erfc.R | ||
b9b9b1afbe458bdac0b8e34ad1e7163e *R/firstlib.R | ||
411d2dcce18a3bef73c4577aea757ed2 *R/ic1.R | ||
a96ad4f75bd8fb4c9386afb8366caa78 *R/is1.R | ||
2544c29d1fdb284e4b8e0b7faa257080 *R/normt3ip.R | ||
ea867ba161640aaa7004b538e0982f03 *R/wofz.R | ||
69ea61dec509d31c2a8954e2e56596a6 *man/dnormt3.Rd | ||
e607dd933db78b0e85db55bf365174f5 *man/dst.Rd | ||
90037f89dc17dab9a589590bc90a910c *man/erf.Rd | ||
48cb03b2e588846b870566ec6b8ed0f7 *man/erfc.Rd | ||
f28360e4fcdb9b5801cd25324b6dd2b1 *man/ic1.Rd | ||
335b5adaf6aff4553056ca6fbf699dca *man/is1.Rd | ||
b6f6de285b52f88e67c8f850033e3768 *man/normt3ip.Rd | ||
11b45690e9d2298505aba5446c28f75f *man/wofz.Rd | ||
46c60069216c8375f3caa9b8f7ef8b6e *src/IPerfcvec.c | ||
3897cb5687a7258aa7f64e824657a414 *src/IPwofzvec.c | ||
6b033d6d3f308a67c31739db00f4d6de *src/toms680-1.f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Default NAMESPACE created by R | ||
# Remove the previous line if you edit this file | ||
|
||
# Export all names | ||
exportPattern(".") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"wofz" <- | ||
function(z){ | ||
|
||
ans <- .C("IPwofzvec", | ||
x=as.double(Re(z)), | ||
y=as.double(Im(z)), | ||
ansx=as.double(Re(z)), | ||
ansy=as.double(Im(z)), | ||
n = as.integer(length(z)), | ||
error = as.integer(0), | ||
PACKAGE="NORMT3") | ||
if (ans$error != 0) | ||
stop(paste("Error code from TOMS 680 was ", ans$error)) | ||
|
||
return(complex(real=ans$ansx, im=ans$ansy)) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
\name{wofz} | ||
\alias{wofz} | ||
\title{Faddeeva function} | ||
\description{ | ||
Computes the Faddeeva function of a complex valued argument. This function is | ||
\deqn{\exp{-z^2}*erfc(-iz)} . | ||
} | ||
\usage{ | ||
wofz(z) | ||
} | ||
\arguments{ | ||
\item{z}{Argument of Faddeeva function} | ||
} | ||
\details{ | ||
Computes the Faddeeva function of a complex valued argument. This function is | ||
\deqn{\exp{-z^2}*erfc(-iz)} | ||
|
||
This function calls FORTRAN code (algorithm TOMS 680) | ||
which computes the Faddeeva function. | ||
} | ||
\value{ | ||
The Faddeeva function, w(z) | ||
} | ||
\references{ | ||
Poppe, G.P.M. and Wijers, C.M.J. (1990) More efficient computation of the | ||
complex error function. \emph{ACM Transactions on Mathematical | ||
Software}, \bold{16}, 38--46. | ||
} | ||
\author{Krishna Myneni, krishna.myneni@ccreweb.org} | ||
|
||
|
||
\seealso{\code{\link{erf} \link{erfc}}} | ||
\examples{ | ||
options(digits=15) | ||
wofz(0) | ||
# | ||
# Should give 1+0i | ||
# | ||
wofz(1) | ||
# | ||
# Should give 0.367879441171442+0.607157705841394i | ||
# | ||
wofz(complex(re=1, im=1)) | ||
# | ||
# Should give 0.304744205256913+0.208218938202832i | ||
# | ||
} | ||
\keyword{math} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include <math.h> | ||
|
||
/* | ||
* IPwofzvec - compute Faddeeva function, w(z) on a vector of complex values | ||
* | ||
* | ||
* Input: x + iy (x and y are double vectors containing the real | ||
and imaginary parts of the complex vector that | ||
you wish to transform) | ||
* Output: ansx + i ansy (ansx and ansy are double vectors containing | ||
the real and imaginary parts of the transformed vector) | ||
* Other variables: | ||
* | ||
* n: Length of each of the vectors x, y, ansx, ansy | ||
* | ||
* error: Error code from the routine that computes Faddeva's function | ||
(computed by TOMS routine 680). Zero means no error. | ||
*/ | ||
|
||
void IPwofzvec(double *x, double *y, double *ansx, double *ansy, int *n, | ||
int *error) | ||
{ | ||
int i, flag; | ||
void IPwofz(); | ||
void wofz_(); | ||
|
||
for(i=0; i< *n; ++i) { | ||
wofz_( x+i, y+i, ansx+i, ansy+i, &flag); | ||
|
||
if (flag != 0) { | ||
*error = flag; | ||
return; | ||
} | ||
} | ||
} | ||
|
||
void IPwofz(double *a, double *b, double *outa, double *outb, int *error) | ||
{ | ||
|
||
double d, e; | ||
void wofz_(); | ||
|
||
*error =0l; | ||
|
||
/* Want to work out w(ia+b) */ | ||
|
||
wofz_( a, b, &d, &e, error); | ||
if (*error) return; | ||
|
||
*outa = d; | ||
*outb = e; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters