FSCorAnaenv

FSCorAnaenv computes the empirical envelopes of Min MD outside subset and inertia explained during the search

Syntax

  • MMDenv=FSCorAnaenv(N)example
  • MMDenv=FSCorAnaenv(N,Name,Value)example
  • [MMDenv, INEenv]=FSCorAnaenv(___)example
  • [MMDenv, INEenv, nsimul]=FSCorAnaenv(___)example

Description

example

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

example

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

example

[MMDenv, INEenv] =FSCorAnaenv(___) Monitor the inertia explained.

example

[MMDenv, INEenv, nsimul] =FSCorAnaenv(___)

Examples

expand all

  • Call of FSCorAnaenv with all the default options.
  • Generate contingency table of size 50-by-5 with total sum of n_ij=10000.

    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=FSCorAnaenv(N);
    plot(MMDenv(:,1),MMDenv(:,2:4),'k')
    xlabel('Subset size m');
    Click here for the graphical output of this example (link to Ro.S.A. website).

  • Call of FSCorAnaenv 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=FSCorAnaenv(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')

  • Monitor the inertia explained.
  • Compute 0.01 0.5 0.99 envelopes Generate contingency table of size 20-by-5 with total sum of n_ij=2000.

    I=20;
    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;
    [~,INEenv]=FSCorAnaenv(N,'prob',[0.01 0.5 0.99],'nsimul',1000);
    plot(INEenv(:,1),INEenv(:,2:end),'r-')
    xlabel('Subset size m')

    Input Arguments

    expand all

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

    If N is a structure it must contain the fields:

    Value Description
    N

    contingency table in array format of size I-by-J (this field is compulsory).

    NsimStore

    array of size I-by-J times nsimul containing in each column the nsimul simulated contingency tables.

    If this field is not present the nsimul simulated contingency tables are generated by this routine.

    Note that input structure N can be conveniently created by function mcdCorAna.

    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.

    Note that this input option is ignored if N is a struct and field N.NsimStore is present. In this last case nsimul is equal to the number of columns of N.NsimStore

    Example: 'nsimul',100

    Data Types: double

    Output Arguments

    expand all

    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].

    INEenv —Envelopes for the requested quantiles of inertia explained. n-m0+1 x length(prob)+1 columns

    1st col = fwd search index from m0 to n1;

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

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

    ...;

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

    nsimul —number of simulations. Scalar

    Number of simulations which have been used to create the envelope

    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.

    See Also

    |

    This page has been automatically generated by our routine publishFS