Program: MKLSZOPTIMTEST

  mklszoptimtest.......test efficiency of vertical sampling algorithm
 
  call: mklszoptimtest(sampleanz,maxstepsize,matchthresh,zets,drmin,runs,metaruns,plotmode);
 
          sampleanz: (number) [counter]
                     number of depth samples that define the step function
 
        maxstepsize: (number) [counter]
                     maximum size of vertical steps in function: at the
                     position of the depth samples, the function will
                     change by no more than this, in integer steps.
 
        matchthresh: (number) [percent]
                     value for lsopt.iter_matchthresh, to be used in tests
 
               zets: (numeric array) [km]
                     List of initial depth samples to be used. The sampling
                     algorithm will start with these samples.
                     Thee values are depths inside the earth, i.e. these
                     must be values from 0 to 6371.
                     The first value MUST be zero.
                     Enter (0:1/n:1)*6371 to start with an n samples
                     uniform sampling.
 
               drmin: (number) [km]
                     The minimum allowed distance between function samples: the
                     search is stopped when the shortest sample distance is shorter
                     than this. 
 
               runs: (number) [counter]
                     number of test runs to be made
                     After RUNS runs of the vertical optimization
                     algorithm, the number of failures and the cost saving
                     (relative to a uniform sampling) will be determined
 
           plotmode: (number) [flag]
                     numerical flag to swtich on and off the production of
                     control plots during tests.
                     possible values:
                     'off': no plot
                     'histogram': histogram plot after each set of RUNS runs
                     'function': as 1, but additionally plots the step function and
                        the progress of the sampling
 
  result: efficiency: (numeric array) [percent]
                      RUNS elements array, containing a list of the individual
                      efficincy results of each optimization run (i.e. the entire distribution)
 
          reliability: (numeric array) [percent]
                      RUNS element array, containing a list of the
                      individual reliability results of each optimization
                      run (i.e. the entire distribution)
 
                    
 
  This routine estimates the reliability of the vertical optimization
  algorithm used in LOCSMITH.
  This algorithm is used to determine the possible focal depths of the quake
  in consideration. To do so, all maxima of the degree-of-compatibility
  function (as function of depth) have to be determined. The values of this
  function are always positive integers, the function is thus a step
  function.
  A uniform depth sampling could be used, but is too expensive in terms of
  CPU time. Therefore the algorithm in MKLSGRIDNEWVERTICAL is used to
  construct a non-uniform sampling at lesser cost.
 
  The questions to be answered are:
  - Is this algorithm reliable?
    This means: in how many cases does it NOT find all possible solutions?
 
  - Is this algorothm efficient?
    This means: how many evaluations of the target function are saved
                compared to the uniform sampling?
 
  To answer these questions, test runs wih random step functions are done.
  Each run of the algorithm produces a certain depth sampling in which a
  certain number of points is at the upper most step of the function. For
  comparison, a uniform sampling with sample distance equal to the smallest
  sample distance of the non-uniform sampling is carried out. This is done
  in a way that the non-uniform sampling produces a subset of the uniform
  sampling.
  Reliability can then be expressed as the number of missing
  maximum-samples in the non-uniform sampling.
  Efficiency can be expressed as ratio of function evaluations in the two
  samplings.
 
  RUNS runs of this procedure are made to get a statistical estimate, which
  is necessary since the step functions are generated randomly.
  These runs produce empirical distributions of both reliability and efficiency,
  which are returned.
 
 
  Martin Knapmeyer, 30.09.2005, 06.10.2005

Read M-File Source Code


eof.