1

You can build a timeseries for mean or standard deviation band values over a geometry in Google Earth Engine (see code below). However, there does not appear to be an option to plot a timeseries of Coefficient of Variation, despite mean and standard deviation reducers being available.

To generate a Coefficient of Variation timeseries, you could generate mean and standard deviation timerseries and calculate the CV for each plot outside of Google Earth Engine, but this seems impractical. Can this calculation be performed from reducers inside Google Earth Engine?

var evoNDvI = ui.Chart.image.seriesByRegion(
  S2,                // Image collection
  geometry,      // Region
  ee.Reducer.mean(), // Type of reducer
  'ndvi',              // Band
  10);               // Scale
  
var plotNDvI = evoNDvI                    // Data
    .setChartType('LineChart')            // Type of plot
    .setOptions({                         // Plot customization
      interpolateNulls: true,
      lineWidth: 1,
      pointSize: 3
});

print(plotNDvI)
1
  • CV is simply the ratio of the standard deviation to the mean sd/mean. However, keep in mind that for long duration time series data you encounter the long run problem that requires a special case of variance (Omega). Long run variance is basically a measure of the standard error of the sample mean. This can be done efficiently using a kernel function to derive weights. I doubt that this is available in GEE but, it is worth checking. May be tricky to code yourself but, is a necessity for a correct specification of the statistic. Commented Nov 6, 2023 at 23:24

1 Answer 1

2

This appears to be just the stddev/mean of each image, plotted. Something like this:

var result = S2.map(function(img) {
    var mean = img.select('ndvi').reduceRegion(ee.Reducer.mean(), geometry, scale)
    var stddev = img.select('ndvi').reduceRegion(ee.Reducer.stdDev(), geometry, scale)
    return img.set('cv', stddev.get('stdDev').divide(mean.get('mean'))
})

print(ui.Chart.feature.byFeature(result, 'system:time_start', 'cv'))
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.