<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div class="" style="">Dear R users:</div><div class="" style=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal" class="">I have encountered a problem on R package GeneralizedHyperbolic. It fails to integrate for the lower tail area but I do not know how to solve it. Listed below are my coding and the error message:</div><div style="color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal" class=""><br class="" style=""></div><div style="background-color: transparent" class="">require(GeneralizedHyperbolic)</div><div style="background-color: transparent" class="">return =
 read.csv("d://UK.R.csv",blank.lines.skip=TRUE,stringsAsFactors=FALSE)</div><div style="background-color: transparent" class=""># return <- apply(series, function(x) diff(log(x)))</div><div style="background-color: transparent" class=""><span style="background-color: transparent; font-size: 12pt" class="">UK= as.numeric(return[,2])</span><br class="" style=""></div><div style="background-color: transparent" class=""><span style="background-color: transparent; font-size: 12pt" class="">UK.R=diff(log(na.omit(UK)))</span><br class="" style=""></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; font-style: normal" class="">period=50 # moving-window length</div><div style="background-color: transparent" class=""><span style="background-color: transparent" class="">n=length(UK.R)</span></div><div style="background-color: transparent; color: rgb(0, 0,
 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; font-style: normal" class="">VaR05.UK.qghyp <- numeric(n-period)</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; font-style: normal" class="">for (p in 1:(n-period))</div><div style="background-color: transparent" class="">{</div><div style="background-color: transparent" class="">  temp = UK.R[p:(period+p)]</div><div style="background-color: transparent" class=""> <span style="background-color: transparent; font-size: 12pt" class="">  probabilities6 <- 0.05</span></div><div style="background-color: transparent" class=""><span style="background-color: transparent; font-size: 12pt" class="">  VaR0001.UK.qghyp[p]<- qhyperb(probabilities6,param
 =c(hyperbFit(temp)[1]$param[1],hyperbFit(temp)[1]$param[2],hyperbFit(temp)[1]$param[3],hyperbFit(temp)[1]$param[4]),lower.tail = TRUE, method = c("spline"),subdivisions = 50)</span><br class="" style=""></div><div style="background-color: transparent" class=""> <span style="background-color: transparent; font-size: 12pt" class="">} </span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; font-style: normal" class=""><span style="background-color: transparent; font-size: 12pt" class=""><br class="" style=""></span></div><div style="background-color: transparent" class=""><span style="color: rgb(0, 0, 0); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; font-style: normal; background-color: transparent" class="">ERROR message: </span><span style="background-color: transparent" class="">Error in integrate(dghypInt, q[i],
 Inf, subdivisions = subdivisions, rel.tol = intTol,  : </span></div><div style="background-color: transparent" class="">  the integral is probably divergent</div><div style="background-color: transparent" class=""><br class="" style=""></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; font-style: normal" class="">If I change the method to integrate, it shows the error message below:</div><div style="background-color: transparent" class="">Error in uniroot(zeroFun, interval = c(mode, xHigh), ...) : </div><div style="background-color: transparent" class="">  f() values at end points not of opposite sign</div><div style="background-color: transparent" class="">In addition: Warning messages:</div><div style="background-color: transparent" class="">1: In optimize(f = modeFun, interval = range, maximum = TRUE) :</div><div
 style="background-color: transparent" class="">  NA/Inf replaced by maximum positive value</div><div style="background-color: transparent" class="">2: In optimize(f = modeFun, interval = range, maximum = TRUE) :</div><div style="background-color: transparent" class="">  NA/Inf replaced by maximum positive value</div><div style="background-color: transparent" class="">3: In optimize(f = modeFun, interval = range, maximum = TRUE) :</div><div style="background-color: transparent" class="">  NA/Inf replaced by maximum positive value</div><div style="background-color: transparent" class="">4: In optimize(f = modeFun, interval = range, maximum = TRUE) :</div><div style="background-color: transparent" class="">  NA/Inf replaced by maximum positive value</div><div style="background-color: transparent" class="">5: In optimize(f = modeFun, interval = range, maximum = TRUE) :</div><div style="background-color: transparent" class=""> 
 NA/Inf replaced by maximum positive value</div><div style="background-color: transparent" class="">6: In optimize(f = modeFun, interval = range, maximum = TRUE) :</div><div style="background-color: transparent" class="">  NA/Inf replaced by maximum positive value</div><div style="background-color: transparent" class=""><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;" class="">Does any people can help solve this problem?</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;" class=""><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;" class="">Best
 regards,</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;" class=""><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16.000001907348633px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;" class="">Weihan</div><div style="background-color: transparent" class=""><br></div></div></body></html>