ds_list_vrm

Downloadds_list_vrm(id [,sample])   Returns the variance-to-mean ratio (V.R.M.) of the given list.
/*
**  Usage:
**      ds_list_vrm(id [,sample])
**
**  Arguments:
**      id          list data structure
**      sample      set to TRUE if the list is made up of a sample
**
**  Returns:
**      the variance-to-mean ratio (V.R.M.) of the given list, real
**
**  GMLscripts.com
*/

{
    var n, avg, sum, i;
    n = ds_list_size(argument0);
    avg = 0;
    sum = 0;

    for (i=0; i<n; i+=1) avg += ds_list_find_value(argument0, i);
    avg /= n;
    for (i=0; i<n; i+=1) sum += sqr(ds_list_find_value(argument0, i) - avg);

    return sum/(n - argument1)/avg;
}

Click if you've used this script[Please Login]
Projects: 6


comments powered by Disqus