ApproxOp is an R package providing a unified
computational framework for positive linear approximation operators.
The package is designed for defining, evaluating, analyzing, comparing, and visualizing classical and generalized approximation operators within a common interface. It also provides tools for ordinary and central moments, numerical moment verification, approximation errors, convergence analysis, parameter studies, and user-defined operators.
ApproxOp currently provides:
family / subfamily /
variant operator architecture;n;The package is designed to be extensible, so additional operator families, subfamilies, and variants can be incorporated into the same framework.
Once available on CRAN, the released version can be installed with:
install.packages("ApproxOp")The development version can be installed from GitHub with:
# install.packages("pak")
pak::pak("edmond-aliaga/ApproxOp")Load the package:
library(ApproxOp)Create a Bernstein operator:
B <- approx_operator(
family = "bernstein",
n = 20
)
BApproximate the function (f(x)=x^2):
f <- function(x) x^2
approximate(
operator = B,
f = f,
x = c(0.25, 0.50, 0.75)
)Ordinary moments can be computed up to order 8:
moments(
operator = B,
order = 4,
x = 0.5
)Central moments are obtained with:
moments(
operator = B,
order = 4,
x = 0.5,
central = TRUE
)The analytical/computational moment engine can also be checked against direct numerical evaluation:
verify_moments(
operator = B,
order = 4,
x = 0.5
)Pointwise approximation errors can be computed with:
approx_error(
operator = B,
f = f,
x = seq(0, 1, length.out = 101)
)Convergence over several values of n can be studied
using:
convergence(
operator = B,
f = f,
grid = seq(0, 1, length.out = 101),
n = c(5, 10, 20, 50)
)ApproxOp provides a common framework for comparing
different approximation operators using numerical error measures and
graphical tools.
It also supports one- and two-dimensional parameter scans for parameterized operator families.
New operators can be incorporated through
register_operator(). This allows users to extend the
framework without modifying the core package.
Registered operators can be examined with:
check_operator(...)which provides numerical diagnostics such as evaluation, finiteness, constant reproduction, and positivity checks.
ApproxOp is under active development. Future versions
may extend the framework with additional operator families and integral
or fractional variants.
Bug reports and suggestions can be submitted through the GitHub issue tracker.
Edmond Aliaga
Department of Mathematics and Computer Sciences
University of Prishtina, Kosovo