# TestFunctions v0.2.0

0

Monthly downloads

0th

Percentile

## Test Functions for Simulation Experiments and Evaluating Optimization and Emulation Algorithms

Test functions are often used to test computer code. They are used in optimization to test algorithms and in metamodeling to evaluate model predictions. This package provides test functions that can be used for any purpose. Some functions are taken from <https://www.sfu.ca/~ssurjano>, but their R code is not used.

# TestFunctions

## Why should I use it?

This R package provides functions for various surfaces that can be used for testing of models, algorithms, etc. For example, if you want to compare how well a neural network does compared to a random forest, you can take data from one of these test functions to train and test them.

## How do I use it?

Each of the test functions is called like any other function. The first argument, x, should be a vector representing one point or a matrix that has points in its rows. This can cause problems if you are using a 1-dimensional function and pass in a vector of values. Instead you should pass them in as a matrix with a single column, or vectorize the function.

set.seed(0)
library(TestFunctions)
branin(runif(2))
#> [1] 9.476405
branin(matrix(runif(20), ncol=2))
#>  [1]  24.119600  71.180268  18.374071   9.839029  36.607437  72.884496
#>  [7] 196.302169  25.185022  13.059216  27.129463

ContourFunctions::cf(banana)


## How do I get it?

Install it like any other package with install.packages.

install.packages("TestFunctions")

# Or the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("CollinErickson/TestFunctions")


## Functions in TestFunctions

 Name Description TF_beale TF_beale: Beale function for evaluating a single point. TF_detpep8d TF_detpep8d: detpep8d function for evaluating a single point. TF_welch TF_welch: Welch function for evaluating a single point. TF_wingweight TF_wingweight: Wing weight function for evaluating a single point. TF_RoosArnold TF_RoosArnold: Roos & Arnold (1963) function for evaluating a single point. TF_ackley TF_ackley: Ackley function for evaluating a single point. TF_hartmann TF_hartmann: hartmann function for evaluating a single point. TF_hump TF_hump: Hump function for evaluating a single point. TF_rastrigin TF_rastrigin: Rastrigin function for evaluating a single point. TF_robotarm TF_robotarm: Robot arm function for evaluating a single point. TF_morris TF_morris: morris function for evaluating a single point. TF_piston TF_piston: Piston simulation function for evaluating a single point. TF_quad_peaks TF_quad_peaks: quad_peaks function for evaluating a single point. TF_quad_peaks_slant TF_quad_peaks_slant: quad_peaks_slant function for evaluating a single point. branin Test function. TF_GoldsteinPriceLog TF_GoldsteinPrice: Goldstein Price function for evaluating a single point TF_branin Base test function. TF_michalewicz TF_michalewicz: Michalewicz function for evaluating a single point. TF_Gfunction TF_Gfunction: G-function for evaluating a single point. TF_GoldsteinPrice TF_GoldsteinPrice: Goldstein Price function for evaluating a single point TF_easom TF_easom: Easom function for evaluating a single point. TF_griewank TF_griewank: Griewank function for evaluating a single point. RFF Evaluate an RFF (random wave function) at given input RFF_get Create a new RFF function TF_levy TF_levy: Levy function for evaluating a single point. TF_linkletter_nosignal TF_linkletter_nosignal: Linkletter (2006) no signal function for evaluating a single point. add_null_dims add_null_dims: Add null dimensions to another function. add_zoom add_zoom: Zoom in on region of another function. nsin Wave functions add_linear_terms add_linear_terms: Add linear terms to another function. add_noise add_noise: Adds noise to any function numHessian Create function calculating the numerical hessian standard_test_func Create a standard test function. numGrad Create function calculating the numerical gradient TF_moon_high TF_moon_high: Moon (2010) high-dimensional function for evaluating a single point. No Results!

## Vignettes of TestFunctions

 Name AnIntroductiontoTestFunctions.Rmd An_Introduction_to_TestFunctions.R An_Introduction_to_TestFunctions.html No Results!

## Details

 Type Package License GPL-3 LazyData TRUE RoxygenNote 6.0.1 VignetteBuilder knitr NeedsCompilation no Packaged 2017-05-09 12:40:28 UTC; cbe117 Repository CRAN Date/Publication 2017-05-09 21:25:06 UTC
 suggests ContourFunctions , knitr , numDeriv , rmarkdown Contributors Collin Erickson