carbikeplot

carbikeplot produces the carbike plot to find best relevant clustering solutions

Syntax

  • h=carbikeplot(RelSol)example
  • h=carbikeplot(RelSol,Name,Value)example

Description

carbikeplot takes as input the output of function tclustICsol (that is a structure containing the best relevant solutions) and produces the car-bike plot. This plot provides a concise summary of the best relevant solutions. This plot shows on the horizontal axis the value of $c$ and on the vertical axis the value of $k$. For each solution we draw a rectangle for the interval of values for which the solution is best and stable and a horizontal line which departs from the rectangle for the values of $c$ in which the solution is only stable. Finally, for the best value of $c$ associated to the solution, we show a circle with two numbers, the first number indicates the ranked solution among those which are not spurious and the second one the ranked number including the spurious solutions. This plot has been baptized ``car-bike'', because the first best solutions (in general 2 or 3) are generally best and stable for a large number of values of $c$ and therefore will have large rectangles. In addition, these solutions are likely to be stable for additional values of $c$ and therefore are likely to have horizontal lines departing from the rectangles (from here the name ``cars''). Finally, local minor solutions (which are associated with particular values of $c$ and $k$) do not generally present rectangles or lines and are shown with circles (from here the name ``bikes'')

example

h =carbikeplot(RelSol) Car-bike plot for simulated data.

example

h =carbikeplot(RelSol, Name, Value) car-bike plot fot the gyeser data.

Examples

expand all

  • Car-bike plot for simulated data.
  • Generate the data

        restrfact=5;
        rng('default') % Reinitialize the random number generator to its startup configuration
        rng(20000);
        ktrue=3;
        % n = number of observations
        n=150;
        % v= number of dimensions
        v=2;
        % Imposed average overlap
        BarOmega=0.04;
    
        out=MixSim(ktrue,v,'BarOmega',BarOmega, 'restrfactor',restrfact);
        % data generation given centroids and cov matrices
        [Y,id]=simdataset(n, out.Pi, out.Mu, out.S);
    
        nsamp=1000;
    
        % Computation of information criterion
        out=tclustIC(Y,'cleanpool',false,'plots',0,'nsamp',nsamp);
    
        % Computation of the best solutions
        % Plot first 3 best solutions using as Information criterion CLACLA
        disp('Best 9 solutions using CLACLA')
        ThreshRandIndex=0.8;
        NumberOfBestSolutions=9;
        [outCLACLA]=tclustICsol(out,'whichIC','CLACLA','plots',0,'NumberOfBestSolutions',NumberOfBestSolutions,'ThreshRandIndex',ThreshRandIndex);
        % Car-bike plot to show what are the most relevant solutions
        carbikeplot(outCLACLA)
    
    
    Starting parallel pool (parpool) using the 'local' profile ...
    connected to 8 workers.
    k=1
    k=2
    k=3
    k=4
    k=5
    Best 9 solutions using CLACLA
    
    ans = 
    
      Figure (1) with properties:
    
          Number: 1
            Name: ''
           Color: [0.9400 0.9400 0.9400]
        Position: [488 342 560 420]
           Units: 'pixels'
    
      Use GET to show all properties
    
    

  • car-bike plot fot the gyeser data.
  •     Y=load('geyser2.txt');
        out=tclustIC(Y,'cleanpool',false,'plots',0,'alpha',0.1);
    
        % Find the best solutions using as Information criterion MIXMIX
        disp('Best solutions using MIXMIX')
        [outMIXMIX]=tclustICsol(out,'whichIC','MIXMIX','plots',0,'NumberOfBestSolutions',6);
        % Produce the car-bike plot
        carbikeplot(outMIXMIX)
    
    k=1
    k=2
    k=3
    k=4
    k=5
    Best solutions using MIXMIX
    
    ans = 
    
      Figure (2) with properties:
    
          Number: 2
            Name: ''
           Color: [0.9400 0.9400 0.9400]
        Position: [488 342 560 420]
           Units: 'pixels'
    
      Use GET to show all properties
    
    

    Input Arguments

    expand all

    RelSol — Relevant solutions produced by function tclustICsol. Structure.

    It contains the following fields.

    Value Description
    MIXMIXbs

    cell of size NumberOfBestSolutions-times-5 which contains the details of the best solutions for MIXMIX (BIC).

    Each row refers to a solution. The information which is stored in the columns is as follows.

    1st col = scalar, value of k for which solution takes place;

    2nd col = scalar, value of c for which solution takes place;

    3rd col = row vector of length d which contains the values of c for which the solution is uniformly better.

    4th col = row vector of length d+r which contains the values of c for which the solution is considered stable (i.e. for which the value of the adjusted Rand index (or the adjusted Fowlkes and Mallows index) does not go below the threshold defined in input option ThreshRandIndex).

    5th col = string which contains 'true' or 'spurious'. The solution is labelled spurious if the value of the adjusted Rand index with the previous solutions is greater than ThreshRandIndex.

    Remark: field out.MIXMIXbs is present only if input option 'whichIC' is 'ALL' or 'whichIC' is 'MIXMIX'.

    MIXMIXbsari

    matrix of adjusted Rand indexes (or Fowlkes and Mallows indexes) associated with the best solutions for MIXMIX. Matrix of size NumberOfBestSolutions-times-NumberOfBestSolutions whose i,j-th entry contains the adjusted Rand index between classification produced by solution i and solution j, $i,j=1, 2, \ldots, NumberOfBestSolutions$.

    Remark: field out.MIXMIXbsari is present only if 'whichIC' is 'ALL' or 'whichIC' is 'MIXMIX'.

    MIXCLAbs

    this output has the same structure as out.MIXMIXbs but it is referred to MIXCLA.

    Remark: field out.MIXCLAbs is present only if 'whichIC' is 'ALL' or 'whichIC' is 'MIXCLA'.

    MIXCLAbsari

    this output has the same structure as out.MIXMIXbs but it is referred to MIXCLA.

    Remark: field out.MIXCLAbsari is present only if 'whichIC' is 'ALL' or 'whichIC' is 'MIXCLA'.

    CLACLAbs

    this output has the same structure as out.MIXMIXbs but it is referred to CLACLA.

    Remark: field out.CLACLAbs is present only if 'whichIC' is 'ALL' or 'whichIC' is 'CLACLA'.

    CLACLAbsari

    this output has the same structure as out.MIXMIXbs but it is referred to CLACLA.

    Remark: field out.MIXCLAbsari is present only if 'whichIC' is 'ALL' or 'whichIC' is 'CLACLA'

    Data Types: struct

    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: 'SpuriousSolutions',false

    SpuriousSolutions —Include or nor spurious solutions.boolean.

    As default spurios solutions are not included into the plot

    Example: 'SpuriousSolutions',false

    Data Types: single | double

    Output Arguments

    expand all

    h —graphics handle to the plot. Graphics handle

    Graphics handle which is produced on the screen.

    References

    A. Cerioli, L.A. Garcia-Escudero, A. Mayo-Iscar and M. Riani (2016), "Finding the Number of Groups in Model-Based Clustering via Constrained Likelihoods", submitted.

    This page has been automatically generated by our routine publishFS