# aceplot

aceplot produces the aceplot to visualize the results of ace

## Syntax

• aceplot(out)example
• aceplot(out,Name,Value)example

## Description

This function produces two figures. The first figure contains a series of panels for transformed X_j vs. X_j (with a rug plot long the tick marks), while the second figure contains: the plot of transformed y vs.

y, the plot of residuals vs. fit and the plot of transformed y vs. fit.

 aceplot(out) Example of the use of ace based on the Wang and Murphy data.

 aceplot(out, Name, Value)

## Examples

expand all

### Example of the use of ace based on the Wang and Murphy data.

In order to have the possibility of replicating the results in R using library acepack function mtR is used to generate the random data.

rng('default')
seed=11;
negstate=-30;
n=200;
X1 = mtR(n,0,seed)*2-1;
X2 = mtR(n,0,negstate)*2-1;
X3 = mtR(n,0,negstate)*2-1;
X4 = mtR(n,0,negstate)*2-1;
res=mtR(n,1,negstate);
% Generate y
y = log(4 + sin(3*X1) + abs(X2) + X3.^2 + X4 + .1*res );
X = [X1 X2 X3 X4];
% Apply the ace algorithm
out= ace(y,X);
% Show the output graphically using function aceplot
aceplot(out)

## Input Arguments

### out — Structure containing the output coming from ace procedure. Structure.

Structure containing the following fields.

Value Description
ty

n x 1 vector containing the transformed y values.

tX

n x p matrix containing the transformed X matrix.

rsq

the multiple R-squared value for the transformed values in the last iteration of the outer loop.

y

n x 1 vector containing the original y values.

X

n x p matrix containing the original X matrix.

Data Types: struct

### Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as  Name1,Value1,...,NameN,ValueN.

Example:  'highlight',1:10 , 'plots', [-3 3; -2 2; -2 2] 

### highlight —units to highliight in the plot.vector.

Vector contaning the numbers associate to the units to highlight in the plots.

Example:  'highlight',1:10 

Data Types: double

### ylimy —2D array of size 3-by-2 which specifies the lower and upper limits for the 3 plots of the second figure.the first row refers to the plot of transformed y vs.

y, the second row refers to the plot of residuals vs.

fit and the third row to the the plot of transformed y vs.

fit. The default value of ylimy is [], that is automtic scale is used.

Example:  'plots', [-3 3; -2 2; -2 2] 

Data Types: single | double

## References

Breiman, L. and Friedman, J.H. (1985), Estimating optimal transformations for multiple regression and correlation, "Journal of the American Statistical Association", Vol. 80, pp. 580-597.

Wang D. and Murphy M. (2005), Identifying nonlinear relationships regression using the ACE algorithm, "Journal of Applied Statistics", Vol. 32, pp. 243-258.