FSRenvmdr

FSRenvmdr computes the theoretical envelopes of Minimum Deletion Residual outside subset during the search

Syntax

  • MDRenv=FSRenvmdr(n,p)example
  • MDRenv=FSRenvmdr(n,p,Name,Value)example

Description

example

MDRenv =FSRenvmdr(n, p) FSRenvmdr with all default options.

example

MDRenv =FSRenvmdr(n, p, Name, Value) Example with plot of the envelopes.

Examples

expand all

  • FSRenvmdr with all default options.
  • Example of creation of 1 per cent, 50 per cent and 99 per cent envelopes based on 1000 observations and 5 explanatory variables

    MDRenv=FSRenvmdr(10000,5);

  • Example with plot of the envelopes.
  • Example of creation of 1%, 50% and 99% envelopes based on 100 observations and 5 explanatory variables

    Menv=FSRenvmdr(100,5);
    plot(Menv(:,1),Menv(:,2:4));

    Related Examples

    expand all

  • Comparing the accuracy of the envelopes computed with order statistics with the simulated ones.
  • Fix a seed

    state=1000;
    mtstream = RandStream('shr3cong','Seed',state);
    %RandStream.setDefaultStream(mtstream);
    RandStream.setGlobalStream(mtstream);
    %defaultStream = RandStream.getDefaultStream();
    defaultStream = RandStream.getGlobalStream();
    reset(defaultStream)
    % If you run this example in a version older than 7.9 replace the previous four lines with
    % randn('state', 1000);
    n=200;
    p=3;
    X=randn(n,p);
    init=20;
    nsimul=1000;
    mdrStore=zeros(n-init,nsimul);
    for j=1:nsimul
    y=randn(n,1);
    [out]=LXS(y,X,'nsamp',1000','msg',0);
    mdr = FSRmdr(y,X,out.bs,'init',init);
    mdrStore(:,j)=mdr(:,2);
    end
    % Sort rows of matrix mdrStore
    mdrStore=sort(mdrStore,2);
    % Create figure which compares empirical and theoretical forward envelopes
    % for minimum deletion residual
    figure;
    hold('on');
    quant=[0.01 0.5 0.99];
    sel=round(nsimul*quant);
    % Plot lines of empirical quantiles
    line(mdr(:,1),mdrStore(:,sel),'LineStyle','--','Color','g');
    % Plots lines of theoretical quantiles using order statistics
    mdrT=FSRenvmdr(n,p+1,'init',init);
    line(mdrT(:,1),mdrT(:,2:4),'LineStyle','-','Color','r');
    xlabel('Subset size m');
    Click here for the graphical output of this example (link to Ro.S.A. website)

    Input Arguments

    expand all

    n — number of observations. Scalar.

    Number of observations on which the envelopes are based.

    Data Types: single| double

    p — number of explanatory variables (including the intercept if present). Scalar.

    Number of expl. variables on which the envelopes are based.

    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',100 starts monitoring from step m=100 , 'prob',[0.01 0.99]

    init —Search initialization.scalar.

    Scalar which specifies the initial subset size to monitor minimum deletion residual, if init is not specified it will be set equal to p+1, if the sample size is smaller than 40;

    min(3*p+1,floor(0.5*(n+p+1))), otherwise.

    Example: 'init',100 starts monitoring from step m=100

    Data Types: double

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

    1 x k vector containing quantiles for which envelopes have to be computed. The default is to produce 1%, 50% and 99% envelopes.

    Example: 'prob',[0.01 0.99]

    Data Types: double

    Output Arguments

    expand all

    MDRenv —forward envelopes of mdr. Matrix

    Matrix with n-m0+1 rows and 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

    Atkinson, A.C. and Riani, M. (2006), Distribution theory and simulations for tests of outliers in regression, "Journal of Computational and Graphical Statistics", Vol. 15, pp. 460-476.

    Riani, M. and Atkinson, A.C. (2007), Fast calibrations of the forward search for testing multiple outliers in regression, "Advances in Data Analysis and Classification", Vol. 1, pp. 123-141.

    See Also

    |

    This page has been automatically generated by our routine publishFS