# HAc

HAc computes breakdown point and efficiency associated with constant c

## Syntax

• bdp=HAc(ctun,v)example
• bdp=HAc(ctun,v,Name,Value)example
• [bdp,eff]=HAc(___)example

## Description

 bdp =HAc(ctun, v) bdp and eff as function of c.

 bdp =HAc(ctun, v, Name, Value)

 [bdp, eff] =HAc(___)

## Examples

expand all

### bdp and eff as function of c.

Analysis of breakdown point and asymptotic efficiency at the normal distribution as a function of c in regression.

cc=0.15:0.05:1.2;
% BDPEFF = matrix which will contain
% 1st column = value of c
% 2nd column = breakdown point (bdp)
% 3rd column = asympotic nominal efficiency (eff)
BDPEFF=[cc' zeros(length(cc),2)];
jk=1;
for c=cc
[bdp,eff]=HAc(c,1);
BDPEFF(jk,2:end)=[bdp, eff];
jk=jk+1;
end
nr=2;
nc=1;
subplot(nr,nc,1)
plot(BDPEFF(:,1),BDPEFF(:,2))
xlabel('c','Interpreter','Latex','FontSize',16)
ylabel('Breakdown point','Interpreter','none')
subplot(nr,nc,2)
plot(BDPEFF(:,1),BDPEFF(:,3))
xlabel('c','Interpreter','Latex','FontSize',16)
ylabel('Asymptotic efficiency','Interpreter','none')

## Input Arguments

### ctun — tuning constant c. Scalar.

Scalar greater than 0 which controls the robustness/efficiency of the estimator

Data Types: single| double

### v — number of response variables. Scalar.

Number of variables of the dataset (for regression v=1) UP TO NOW v=1 (JUST REGRESSION) TO DO FOR MULTIVARIATE ANALYSIS

Data Types: single| double

### 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:  'param',[1.5,3.5,8] , 'shapeeff',1 

### param —tuning parameters.vector.

Vector of length 3 specifying the parameters a, b and c of the weight function of the Hampel estimator.

param(1)=a param(2)=b param(3)=c If these values are not supplied they will be automatically set to a=2, b=4 c=8

Example:  'param',[1.5,3.5,8] 

Data Types: double

### shapeeff —location or shape efficiency.scalar.

If 1, the efficiency is referred to the shape else (default) is referred to the location. TODO:Hac:shapeeff

Example:  'shapeeff',1 

Data Types: double

## Output Arguments

### bdp —bdp. Scalar

Breakdown point associated to the supplied value of c for Hampel rho function

### eff —eff. Scalar

Efficiency associated to the supplied value of c for Hampel rho function

Function HApsi transforms vector u as follows.

$HApsi(u) = \left\{ \begin{array}{cc} u & |u| <= a \\ a \times sign(u) & a <= |u| < b \\ a \frac{c-|u|}{c-b} \times sign(u) & b <= |u| < c \\ 0 & |u| >= c \end{array} \right.$

where $a$= ctun *param(1).

$b$= ctun *param(2).

$c$= ctun *param(3).

The default is $a$= 2*ctun.

$b$= 4*ctun.

$c$= 8*ctun.

It is necessary to have 0 <= a <= b <= c

## References

Hoaglin, D.C., Mosteller, F., Tukey, J.W. (1982), "Understanding Robust and Exploratory Data Analysis", Wiley, New York.