robinhankin / elliptic Goto Github PK
View Code? Open in Web Editor NEWWeierstrass and Jacobi elliptic functions
Weierstrass and Jacobi elliptic functions
Hello Robin,
I've seen you recently updated 'elliptic'. In case you're interested, I recently developed the 'jacobi' package. It provides more or less the same functions as 'elliptic' but it is faster, because the Jacobi theta functions are implemented in C++. Your package was helpful for the development, thanks.
There is a "R package by maintainer" page and it gives this:
checking Rd files ... [1s/1s] NOTE
checkRd: (-1) elliptic-package.Rd:92: Lost braces
92 | J. Kotus and M. Urb\'{a}nski 2003. \emph{Hausdorff dimension and Hausdorff
... and not in R.
There is a problem with nome.k()
pointed out by Vladimiar Dergachev. He says:
Going back to the book of Whittaker and Watson (1920):
on page 486 there is an example of calculation of nome for the case of
k=k'=1/sqrt(2)
giving an answer of q=0.0432139
Whittaker and Watson also uses the convention that m=k^2
and
k'=sqrt(1-k^2)
this means that nome.k(k)=nome(k^2)
and the same for other functions.
But the package gives:
> nome.k(1/sqrt(2))
[1] 0.062372
>
Hello,
thanks for building this package
theta3 function wrongly returns 1 in some specific cases. For instance:
theta3(z = pi/4, q = exp(-pi/4), maxiter = 10000)
gives 1 whereas it should give 0.9135722, such as observed for theta3(z = pi/4+1e-15, q = exp(-pi/4), maxiter = 10000)
.
The issue is the number of iterations that stops after the first step.
This is not sufficient to allow a minimum number of steps, for instance:
theta3(z = pi/4, q = exp(-pi/16), maxiter = 10000)
gives 1 whereas it should give 0.1745516, such as observed for theta3(z = pi/4+1e-15, q = exp(-pi/16), maxiter = 10000)
.
Here comparing with the 2-step previous value would solve the issue, but it may not solve it in all cases.
The test suite should use the testthat
package
The ones used in the package should account for the reasoning in https://journal.r-project.org/articles/RJ-2023-071/
Found if() conditions comparing class() to string:
File ‘elliptic/R/elliptic.R’: if (class(p) == "primitive") ...
File ‘elliptic/R/elliptic.R’: if (class(g) != "parameters") ...
File ‘elliptic/R/elliptic.R’: if (class(g) != "parameters") ...
Use inherits() (or maybe is()) instead.
Rd file 'theta1dash.Rd':
\usage lines wider than 90 characters:
theta1dashdash(z, ignore = NULL, m = NULL, q = NULL, give.n = FALSE, maxiter = 30,miniter=3)
theta1dashdashdash(z, ignore = NULL, m = NULL, q = NULL, give.n = FALSE, maxiter = 30,miniter=3)
These lines will be truncated in the PDF manual.
* checking tests ...
Running ‘aaa.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ...
‘ellipticpaper.Rnw’... failed
‘residuetheorem.Rnw’... OK
ERROR
Errors in running code in vignettes:
when running code in ‘ellipticpaper.Rnw’
...
> png("wp_figure.png", width = 800, height = 800)
> persp(x, y, limit(Re(f)), xlab = "Re(z)", ylab = "Im(z)",
+ zlab = "Re(P(z))", theta = 30, phi = 30, r = 1e+09, border = NA,
+ shade = 0.8 .... [TRUNCATED]
When sourcing ‘ellipticpaper.R’:
Error: figure margins too large
Execution halted
Attaching package: ‘elliptic’
The following objects are masked from ‘package:stats’:
sd, sigma
The following object is masked from ‘package:base’:
is.primitive
Loading required package: emulator
Loading required package: mvtnorm
Loading required package: calibrator
Error: processing vignette 'ellipticpaper.Rnw' failed with diagnostics:
chunk 21 (label = wp_figure_plot)
Error in plot.new() : figure margins too large
--- failed re-building ‘ellipticpaper.Rnw’
macOS 10.6.8 Rosetta, R 4.2.2, gcc 12.2.0
Dear maintainer,
Please see the problems shown on
<https://cran.r-project.org/web/checks/check_results_elliptic.html>.
The check problems with current R-devel are from
\item The default method for generating from a discrete uniform
distribution (used in \code{sample()}, for instance) has been
changed. This addresses the fact, pointed out by Ottoboni and
Stark, that the previous method made \code{sample()} noticeably
non-uniform on large populations. See \PR{17494} for a
discussion. The previous method can be requested using
\code{RNGkind()} or \code{RNGversion()} if necessary for
reproduction of old results. Thanks to Duncan Murdoch for
contributing the patch and Gabe Becker for further assistance.
To make your package successfully pass the checks for current R-devel
and R-release you may find it most convenient to insert
suppressWarnings(RNGversion("3.5.0"))
before calling set.seed() in your example, vignette and test code (where
the difference in RNG sample kinds matters, of course).
Note that this ensures using the (old) non-uniform "Rounding" sampler
for all 3.x versions of R, and does not add an R version dependency.
Note also that the new "Rejection" sampler which R will use from 3.6.0
onwards by default is definitely preferable over the old one, so that
the above should really only be used as a temporary measure for
reproduction of the previous behavior (and the run time tests relying on
it).
It would be nice to implement domain colouring in view()
:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.