R functions for evaluation of the Hartman-Watson function
The function
The functions
The
The code approximates the functions
The function Fexp(rho,n) computes the function
The function Gexp(rho,n) computes the function
The function thetaHW(r,t,n) returns
The function Finterp(rho) evaluates the function
The function Ginterp(rho) evaluates
#Reproduce the plots in Figure 4 of https://arxiv.org/abs/2001.09579 giving thetaHW(r,t) for r = 0.5, 1.0, 1.5
source("HWfunctions.R")
x <- seq(0, 4, 0.01)
n <- length(x)
y1 <- c()
y2 <- c()
y3 <- c()
for (i in 1:n) {
y1 <- c(y1,thetaHW(0.5,x[i]))
y2 <- c(y2,thetaHW(1.0,x[i]))
y3 <- c(y3,thetaHW(1.5,x[i]))
}
plot(y1~x, type="l", col="black", main="thetaHW(r,t)", ylim=c(0,2.5), xlab="t",ylab="theta(r,t)")
lines(y2~x, type="l", col="blue")
lines(y3~x, type="l", col="red")
The approximation error for
The approximation error for