New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potentially use orthopolynom for more polynomial expansions #286
Comments
This could be an option to |
This is going to be hard to do the orthopolynom_wrapper <- function(degree) {
polynomials <- rlang::call2(
"chebyshev.c.polynomials",
n = degree,
normalized = TRUE,
.ns = "orthopolynom"
)
eval(polynomials)
}
orthopolynom_wrapper(4)
#> Error in polynomial(c(1/sqrt(h.0))): could not find function "polynom"
library(orthopolynom)
#> Loading required package: polynom
orthopolynom_wrapper(4)
#> [[1]]
#> 0.1994711
#>
#> [[2]]
#> 0.1410474*x
#>
#> [[3]]
#> -0.2820948 + 0.1410474*x^2
#>
#> [[4]]
#> -0.4231422*x + 0.1410474*x^3
#>
#> [[5]]
#> 0.2820948 - 0.5641896*x^2 + 0.1410474*x^4 orthopolynom::chebyshev.c.polynomials
#> function (n, normalized = FALSE)
#> {
#> recurrences <- chebyshev.c.recurrences(n, normalized)
#> if (normalized) {
#> h.0 <- 8 * pi
#> p.0 <- polynomial(c(1/sqrt(h.0)))
#> polynomials <- orthonormal.polynomials(recurrences, p.0)
#> }
#> else polynomials <- orthogonal.polynomials(recurrences)
#> return(polynomials)
#> }
#> <bytecode: 0x7fe628dd18d0>
#> <environment: namespace:orthopolynom> |
I'd say that we should close the issue. This was a nice to have but we are not going to take on other dependencies for a niche feature. |
Agree. This feature would be a fairly straightforward for someone to put in an extension package as another step if they really need it. |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue. |
Low dependencies. Seems like it has been out for awhile and is well tested. Chebyshev polynomial expansions were requested in the DC workshop.
The text was updated successfully, but these errors were encountered: