# FSCorAnaenvmmd

FSCorAnaenvmmd computes the empirical envelopes of Minimum MD outside subset during the search

## Syntax

• MMDenv=FSCorAnaenvmmd(N)example
• MMDenv=FSCorAnaenvmmd(N,Name,Value)example

## Description

 MMDenv =FSCorAnaenvmmd(N) Call of FSCorAnaenvmmd with all the default options.

 MMDenv =FSCorAnaenvmmd(N, Name, Value) Call of FSCorAnaenvmmd with options prob and nsimul.

## Examples

expand all

### Call of FSCorAnaenvmmd with all the default options.

Generate contingency table of size 30-by-5 with total sum of n_ij=3000.

I=50;
J=5;
n=10000;
% nrowt = column vector containing row marginal totals
nrowt=(n/I)*ones(I,1);
% ncolt = row vector containing column marginal totals
ncolt=(n/J)*ones(1,J);
out1=rcontFS(I,J,nrowt,ncolt);
N=out1.m144;
MMDenv=FSCorAnaenvmmd(N);
plot(MMDenv(:,1),MMDenv(:,2:4),'k')
xlabel('Subset size m');

### Call of FSCorAnaenvmmd with options prob and nsimul.

Compute 0.001 0.01 0.99 and 0.999 envelopes Generate contingency table of size 50-by-5 with total sum of n_ij=2000.

I=50;
J=5;
n=2000;
% nrowt = column vector containing row marginal totals
nrowt=(n/I)*ones(I,1);
% ncolt = row vector containing column marginal totals
ncolt=(n/J)*ones(1,J);
out1=rcontFS(I,J,nrowt,ncolt);
N=out1.m144;
MMDenv=FSCorAnaenvmmd(N,'prob',[0.001 0.01 0.99 0.999],'nsimul',1000);
hold('on')
plot(MMDenv(:,1),MMDenv(:,3:4),'r-')
plot(MMDenv(:,1),MMDenv(:,[2 5]),'k-')
xlabel('Subset size m')

## Input Arguments

### N — contingency table or structure. Array or table of size I-by-J or strucure.

If N is a structure it must contain the field N.N = contingency table in array format of size I-by-J.

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:  'init',50 , 'prob',[0.05 0.95] , 'nsimul',100 

### init —Point where to start monitoring required diagnostics.scalar.

Note that if bsb is supplied, init>=length(bsb). If init is not specified it will be set equal to floor(n*0.6).

Example:  'init',50 

Data Types: double

### prob —quantiles for which envelopes have to be computed.vector.

Vector containing 1 x k elements .

The default is to produce 1 per cent, 50 per cent and 99 per cent envelopes.

Example:  'prob',[0.05 0.95] 

Data Types: double

### nsimul —numer of simulations.scalar.

Number of simulations to perform. The default value is 200.

Example:  'nsimul',100 

Data Types: double

## Output Arguments

### MMDenv —Envelopes for the requested quantiles. n-m0+1 x length(prob)+1 columns

1st col = fwd search index from m0 to n-1;

2nd col = envelope for quantile prob[1];

3rd col = envelope for quantile prob[2];

...;

(k+1) col = envelope for quantile prob[k].

## References

Riani, M., Atkinson, A.C. and Cerioli, A. (2009), Finding an unknown number of multivariate outliers, "Journal of the Royal Statistical Society Series B", Vol. 71, pp. 201-221.