First Friedman Dataset and a variation


Generate X and Y values from the 10-dim “first” Friedman data set used to validate the Multivariate Adaptive Regression Splines (MARS) model, and a variation involving boolean indicators. This test function has three non-linear and interacting variables, along with two linear, and five which are irrelevant. The version with indicators has parts of the response turned on based on the setting of the indicators


2 = 100)
fried.bool(n = 100)



Number of samples desired


In the original formulation, as implemented by the function has 10-dim inputs X are drawn from Unif(0,1), and responses are N(m(X),1) where m(X) = E[f(X)] and

m(X) = 10*sin(pi*X[,1]*X[,2]) + 20*(X[,3]-0.5)^2 + 10*X[,4] + 5*X[,5]

The variation fried.bool uses indicators I in 1:4. The function also has 10-dim inputs X with columns distributed as Unif(0,1) and responses are N(m(X,I), 1) where m(X,I) = E[f(X,I)] and

m(X,I) = fI(X) if I in 1:3 else m(X[,10:1])


f1(X)=10*sin(pi*X[,1]*X[,2]), f2(X)=20*(X[,3]-0.5)^2, f3(X)=10*X[,4]+5*X[,5]

The indicator I is coded in binary in the output data frame as: c(0,0,0) for I=1, c(0,0,1) for I=2, c(0,1,0) for I=3, and c(1,0,0) for I=4.


Output is a data.frame with columns

X.1, ..., X.10

describing the 10-d randomly sampled inputs

I.1, ..., I.3

boolean version of the indicators provided only for fried.bool, as described above


sample responses (with N(0,1) noise)


true responses (without noise)


An example using the original version of the data ( is contained in the first package vignette: vignette("tgp"). The boolean version fried.bool is used in second vignette vignette("tgp2")


Robert B. Gramacy,, and Matt Taddy,


Gramacy, R. B. (2007). tgp: An R Package for Bayesian Nonstationary, Semiparametric Nonlinear Regression and Design by Treed Gaussian Process Models. Journal of Statistical Software, 19(9).

Robert B. Gramacy, Matthew Taddy (2010). Categorical Inputs, Sensitivity Analysis, Optimization and Importance Tempering with tgp Version 2, an R Package for Treed Gaussian Process Models. Journal of Statistical Software, 33(6), 1–48.

Friedman, J. H. (1991). Multivariate adaptive regression splines. “Annals of Statistics”, 19, No. 1, 1–67.

Gramacy, R. B., Lee, H. K. H. (2007). Bayesian treed Gaussian process models with an application to computer modeling Journal of the American Statistical Association, to appear. Also available as ArXiv article 0710.4536

Chipman, H., George, E., \& McCulloch, R. (2002). Bayesian treed models. Machine Learning, 48, 303–324.

See Also

bgpllm, btlm, blm, bgp, btgpllm, bgp

comments powered by Disqus