Project

General

Profile

Getting how many standard deviations points on a file are away from another file

Added by Adekunle Adesanya 11 months ago

I'm working on comparisons between RCP and Gx data, and would appreciate help with figuring out how to output a file that'd show how many standard deviations away from the RCP average the Gx data would be. I've tried timstd, but it isn't quite what I'm looking for.


Replies (3)

RE: Getting how many standard deviations points on a file are away from another file - Added by Adekunle Adesanya 11 months ago

Just to be more specific, I'm making use of a framework that categorizes the effectiveness of geoengineering by evaluating whether the change in a given value falls within 2 standard deviations of the historical mean, is closer to the historical mean than RCPx while being outside 2 standard deviations of the historical mean, or is further away from the historical mean than RCPx. Any assistance would be really appreciated.

RE: Getting how many standard deviations points on a file are away from another file - Added by Ralf Mueller 11 months ago

hi!

I would work with location dependent masks: given the value v at some location and its std-deviation vstd and 2vmean@ , you can use the expr operators to check if its beyond a given range. something like

cdo -expr,'mask = ( abs(v - vmean) < vstd/2 ) ? 0 : 1' <ifile> <ofile>

This should create a 0-1-mask, where 0 marks locations that have values withing 1-sigma, 1 going outside this range. Later on you can divide your original data by that mask to create missing values on locations with 0 and keeping the values elsewhere.

expr does allow to do this directly with

 cdo -expr,'above_1_sigma = ( abs(v - vmean) < vstd/2 ) ? v/0 : v' <ifile> <ofile>
but you might use the mask for other tasks as well.

For 2, 3 or 4 sigma you use above_1_sigma = ( abs(v - vmean) < N*vstd/2 ) ? v/0 : v' with N being set accordingly

hth
ralf

RE: Getting how many standard deviations points on a file are away from another file - Added by Adekunle Adesanya 11 months ago

I believe this is what I was looking for. Wasn't quite clear on the expression operators. Thank you very much!

    (1-3/3)