Introduction to pwlapprox2d

# Load the pwlapprox2d package
library(pwlapprox2d)

# Run optimization (example: Sigmoid)
res <- optimize_main(
  choice = 1,
  accuracy = 0.0274,
  init_points = 200,
  max_iter = 20,
  verbose = FALSE
)

# Extract breakpoint coordinates
bp <- res$breakpoints_coords

# Print table of x,y coordinates
cat("x,y\n")
## x,y
for(i in 1:nrow(bp)) {
  cat(paste(bp[i, "x"], bp[i, "y"], sep = ","), "\n")
}
## -7,-0.0264889488055993 
## -2.0020248554093,0.0916688841206033 
## 0.917690815957223,0.687171359985721 
## 7,1.0264889488056

mirror server hosted at Truenetwork, Russian Federation.