# HYPk

HYPk computes breakdown point and efficiency for hyp. tan. estimator

## Syntax

• bdp=HYPk(k,p)example
• bdp=HYPk(k,p,Name,Value)example
• [bdp,eff]=HYPk(___)example
• [bdp,eff,A]=HYPk(___)example
• [bdp,eff,A,B]=HYPk(___)example
• [bdp,eff,A,B,d]=HYPk(___)example

## Description

 bdp =HYPk(k, p) HYPk with all default options.

 bdp =HYPk(k, p, Name, Value) HYPk with all default options.

 [bdp, eff] =HYPk(___) HYPk with all default options.

 [bdp, eff, A] =HYPk(___) Example of use optional argument c.

 [bdp, eff, A, B] =HYPk(___) Breakwodn point and efficiency.

 [bdp, eff, A, B, d] =HYPk(___)

## Examples

expand all

### HYPk with all default options.

[bdp]=HYPk(4.5,1);
disp('Break down point')
disp(bdp)

### HYPk with all default options.

[bdp,eff]=HYPk(4.5,1);
disp('efficiency')
disp(eff)

### HYPk with all default options.

[bdp,eff,A,B,d]=HYPk(4.5,1);
disp('Constants A, B and d')
disp(A)
disp(B)
disp(d)

### Example of use optional argument c.

[bdp,eff,A,B,d]=HYPk(4.5,1,'c',3);
disp('Constants A, B and d')
disp(A)
disp(B)
disp(d)

### Breakwodn point and efficiency.

Analysis of breakdown point and asymptotic efficiency at the normal distribution as a function of k (supCVC) in regression.

kk=2:0.1:6;
% BDPEFF = matrix which will contain
% 1st column = value of k
% 2nd column = breakdown point (bdp)
% 3rd column = asympotic nominal efficiency (eff)
% 4th column = value of parameter A
% 5th column = value of parameter B
% 6th column = value of parameter d
BDPEFF=[kk' zeros(length(kk),5)];
% Fixed value of c which must be used
cdef=2.2;
jk=1;
for k=kk
[bdp,eff,A,B,d]=HYPk(k,1,'c',cdef);
BDPEFF(jk,2:end)=[bdp, eff, A, B, d];
jk=jk+1;
end
nr=2;
nc=2;
subplot(nr,nc,1)
plot(BDPEFF(:,1),BDPEFF(:,2))
xlabel('k=sup CVC','Interpreter','Latex','FontSize',16)
ylabel('Breakdown point','Interpreter','none')
subplot(nr,nc,2)
plot(BDPEFF(:,1),BDPEFF(:,3))
xlabel('k=sup CVC','Interpreter','Latex','FontSize',16)
ylabel('Asymptotic efficiency','Interpreter','none')
subplot(nr,nc,3)
plot(BDPEFF(:,1),BDPEFF(:,4:5))
xlabel('k=sup CVC','Interpreter','Latex','FontSize',16)
ylabel('A and B','Interpreter','none')
subplot(nr,nc,4)
plot(BDPEFF(:,1),BDPEFF(:,6))
xlabel('k=sup CVC','Interpreter','Latex','FontSize',16)
ylabel('d','Interpreter','none')
suplabel(['Constant c=' num2str(cdef)],'t');

## Input Arguments

### k — supremum of the change of variance curve. Scalar.

$supCVC(psi,x) x \in R$.

Default value is k=4.5

Data Types: double

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

Number of variables of the dataset (for regression p=1) UP TO NOW p=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:  'c',3 , 'shapeeff',1 

### c —tuning constant c.scalar.

Scalar greater than 0 which controls the robustness/efficiency of the estimator Default value is c=4

Example:  'c',3 

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

### eff —eff. Scalar

Efficiency associated to the supplied value of c

### A —parameter A of hyperbolic tangent estimator. Scalar

For more details see the methodological details inside "More About" below

### B —parameter B of hyperbolic tangent estimator. Scalar

For more details see the methodological details inside "More About" below

### d —parameter d of hyperbolic tangent estimator. Scalar

For more details see the methodological details inside "More About" below

$HYPpsi(u) = \left\{ \begin{array}{cc} u & |u| \leq d \\ \sqrt{A (k - 1)} \tanh \left( \sqrt{(k - 1) B^2/A} (c -|u|)/2 \right) sign(u) & d \leq |u| < c, \\ 0 & |u| \geq c. \end{array} \right.$ It is necessary to have $0 < A < B < 2 normcdf(c)-1- 2 c \times normpdf(c) <1$