[Gsoc-dowd] Thousands of graphics in examples pdf
Dinesh Acharya
dines.acharya at gmail.com
Fri Jul 24 21:23:22 CEST 2015
Dear Peter,
As far as I understand, the multiple (1000 for each KernelES*) plot is due
to the line:
for (i in 1:(n - 1)) {
VaR[i] <- KernelVaRTriangleKernel(PandL, cl + i * delta.cl)
}
Since n is 1000, I can imagine each iteration of loop resulted in a new
plot in the Dowd-Ex.pdf. Though running it in the R, only the final plot
remains visible. (similar to Dowd's code in Matlab)
To avoid multiple plots in the Dowd-Ex.pdf, I have introduced new variable.
So the problem of multiple plots in the pdf is now avoided.
e.g.
for (i in 1:(n - 1)) {
if(i<(n-1)){
VaR[i] <- KernelVaRTriangleKernel(PandL, cl + i * delta.cl, FALSE)
} else if (i == n-1) {
VaR[i] <- KernelVaRTriangleKernel(PandL, cl + i * delta.cl, TRUE)
}
}
However, the execution time will still be greater than 5s and is skipped
(As per my experience, using devtools and also in check log in r-forge,
those 6 functions that have execution time > 5s are skipped, whereas,
command line check does not skip them). Since the package passes the
command line check without skipping those functions, I am not sure how
important it is to consider it.
If you consider it important to avoid that, one possibility is to decrease
the value of "n" in the KernelES* functions from 1000 to less than 500.
(Since I am using single loop only in the code and density function from
stats package, I am not sure, we can optimize the code, but if you have
suggestions, do let me know). The reduction in value of "n" might make plot
or values obtained slightly different from that of Dowd.
Same can be applied to the other two functions (reduction of number of
iterations) or it can be simply ignored.
Let me know what you think of this.
Sincerely,
Dinesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/gsoc-dowd/attachments/20150724/25e6e584/attachment.html>
More information about the GSoC-Dowd
mailing list