powered by
This returns a new function which a linear model has an r-squared of 0.
subtractlm(func, d, n = d * 100)
A new function
A function
Number of input dimensions
Number of points to use for the linear model
subtractlm(ackley, 2) # \donttest{ f <- function(x) { if (is.matrix(x)) x[,1]^2 else x[1]^2 } ContourFunctions::cf(f) ContourFunctions::cf(subtractlm(f, 2), batchmax=Inf) # }
Run the code above in your browser using DataLab