[Met_help] [rt.rap.ucar.edu #73073] History for A question about the source code

John Halley Gotway via RT met_help at ucar.edu
Mon Aug 24 10:06:03 MDT 2015


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

Dear Professor,

An evaluation system based on METv4.1 has been put into operation in my unit. Firstly I want to thank for your hardworking on MET.

    Recently we want to modify the source code, because a very low score is got when the forecast has little and sporadic precipitation and the observation has the same case, we think the low sore is not reasonable. I make the following modification on the code named contable_stats.cc , it works.

Now I have a question about the code named met_stats.cc where the correlation coefficient is computed.

The modified code is

But there are errors

I am not familiar with C++, Can you help me? Look forward to your feedbacks. Your help is highly appreciated.



Kind Regards,

Crystal

 

----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: A question about the source code
From: John Halley Gotway
Time: Fri Aug 21 10:05:41 2015

Crystal,

In the future, please send us the entire modified source code file
instead
of just a snippet.  It's easier to diff the entire file.

I see that you're getting an error when trying to compile the changes
you
added to the "met_stats.cc" file.  The changes to the computation of
the
pearson's correlation coefficient look problematic.  That score is
computed
over continuous matched pair values... meaning the raw forecast and
observation values.  Those statistics are stored in the CNTInfo class.
However, your changes make reference to the CTSInfo class which stores
statistics for categorical statistics which are computed after
thresholding
the raw forecast and observation values.

The problem is that you're mixing continuous and categorical
statistics.

I see in your changes to the computation of CSI that whenever the
forecast
rate and the observation rate (also called base rate) are less than
0.05,
you set CSI to bad data.  That's a reasonable thing to do, although it
would also be pretty easy to apply that logic after the fact to the
MET
output without needing to modify the source code.

It looks like you're trying to add the same logic to the computation
of
correlation... but it doesn't apply.  Correlation is a continuous
statistic
(no threshold involved) while forecast rate and observation rate are
categorical statistics (threshold required).

If you'd like to define criteria for when to set correlation to bad
data,
you'd need to define it based on other continuous statistics, not
categorical ones.

Here's an example of running a STAT-Analysis filter job to discard any
CNT
lines (continuous statistics) where the forecast rate and observation
rate
are less than 0.05.  This is an alternative way of tossing out those
cases
without having to modify the source code.

METv4.1/bin/stat_analysis \
  -lookin
METv4.1/out/grid_stat/grid_stat_120000L_20050807_120000V.stat \
  -job filter -dump_row filter_cts.txt -line_type CTS \
  -column_min BASER 0.05 -column_min FMEAN 0.05

DEBUG 2: STAT Lines read     = 436
DEBUG 2: STAT Lines retained = 36
DEBUG 2:
DEBUG 2: Processing Job 1: -job filter -line_type CTS -column_min
BASER
0.05 -column_min FMEAN 0.05 -dump_row filter_cts.txt
DEBUG 1: Creating STAT output file "filter_cts.txt"
FILTER:        -job filter -line_type CTS -column_min BASER 0.05
-column_min FMEAN 0.05 -dump_row filter_cts.txt
DEBUG 2: Job 1 used 36 out of 36 STAT lines.

This job reads find 56 CTS lines, but only keeps 36 of them where both
the
BASER and FMEAN columns are at least 0.05.

Hope that helps.

Thanks,
John Halley Gotway


On Thu, Aug 20, 2015 at 8:49 PM, Crystal via RT <met_help at ucar.edu>
wrote:

>
> Thu Aug 20 20:49:01 2015: Request 73073 was acted upon.
> Transaction: Ticket created by jinjing_qiu at 163.com
>        Queue: met_help
>      Subject: A question about the source code
>        Owner: Nobody
>   Requestors: jinjing_qiu at 163.com
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=73073 >
>
>
> Dear Professor,
>
> An evaluation system based on METv4.1 has been put into operation in
my
> unit. Firstly I want to thank for your hardworking on MET.
>
>     Recently we want to modify the source code, because a very low
score
> is got when the forecast has little and sporadic precipitation and
the
> observation has the same case, we think the low sore is not
reasonable. I
> make the following modification on the code named contable_stats.cc
, it
> works.
>
> Now I have a question about the code named met_stats.cc where the
> correlation coefficient is computed.
>
> The modified code is
>
> But there are errors
>
> I am not familiar with C++, Can you help me? Look forward to your
> feedbacks. Your help is highly appreciated.
>
>
>
> Kind Regards,
>
> Crystal
>
>
>

------------------------------------------------
Subject: A question about the source code
From: Crystal
Time: Sun Aug 23 19:05:10 2015

Dear Professor,I have solved the problem with your kind help!Thanks
very much!Crystal









At 2015-08-22 00:05:42, "John Halley Gotway via RT"
<met_help at ucar.edu> wrote:
>Crystal,
>
>In the future, please send us the entire modified source code file
instead
>of just a snippet.  It's easier to diff the entire file.
>
>I see that you're getting an error when trying to compile the changes
you
>added to the "met_stats.cc" file.  The changes to the computation of
the
>pearson's correlation coefficient look problematic.  That score is
computed
>over continuous matched pair values... meaning the raw forecast and
>observation values.  Those statistics are stored in the CNTInfo
class.
>However, your changes make reference to the CTSInfo class which
stores
>statistics for categorical statistics which are computed after
thresholding
>the raw forecast and observation values.
>
>The problem is that you're mixing continuous and categorical
statistics.
>
>I see in your changes to the computation of CSI that whenever the
forecast
>rate and the observation rate (also called base rate) are less than
0.05,
>you set CSI to bad data.  That's a reasonable thing to do, although
it
>would also be pretty easy to apply that logic after the fact to the
MET
>output without needing to modify the source code.
>
>It looks like you're trying to add the same logic to the computation
of
>correlation... but it doesn't apply.  Correlation is a continuous
statistic
>(no threshold involved) while forecast rate and observation rate are
>categorical statistics (threshold required).
>
>If you'd like to define criteria for when to set correlation to bad
data,
>you'd need to define it based on other continuous statistics, not
>categorical ones.
>
>Here's an example of running a STAT-Analysis filter job to discard
any CNT
>lines (continuous statistics) where the forecast rate and observation
rate
>are less than 0.05.  This is an alternative way of tossing out those
cases
>without having to modify the source code.
>
>METv4.1/bin/stat_analysis \
>  -lookin
METv4.1/out/grid_stat/grid_stat_120000L_20050807_120000V.stat \
>  -job filter -dump_row filter_cts.txt -line_type CTS \
>  -column_min BASER 0.05 -column_min FMEAN 0.05
>
>DEBUG 2: STAT Lines read     = 436
>DEBUG 2: STAT Lines retained = 36
>DEBUG 2:
>DEBUG 2: Processing Job 1: -job filter -line_type CTS -column_min
BASER
>0.05 -column_min FMEAN 0.05 -dump_row filter_cts.txt
>DEBUG 1: Creating STAT output file "filter_cts.txt"
>FILTER:        -job filter -line_type CTS -column_min BASER 0.05
>-column_min FMEAN 0.05 -dump_row filter_cts.txt
>DEBUG 2: Job 1 used 36 out of 36 STAT lines.
>
>This job reads find 56 CTS lines, but only keeps 36 of them where
both the
>BASER and FMEAN columns are at least 0.05.
>
>Hope that helps.
>
>Thanks,
>John Halley Gotway
>
>
>On Thu, Aug 20, 2015 at 8:49 PM, Crystal via RT <met_help at ucar.edu>
wrote:
>
>>
>> Thu Aug 20 20:49:01 2015: Request 73073 was acted upon.
>> Transaction: Ticket created by jinjing_qiu at 163.com
>>        Queue: met_help
>>      Subject: A question about the source code
>>        Owner: Nobody
>>   Requestors: jinjing_qiu at 163.com
>>       Status: new
>>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=73073 >
>>
>>
>> Dear Professor,
>>
>> An evaluation system based on METv4.1 has been put into operation
in my
>> unit. Firstly I want to thank for your hardworking on MET.
>>
>>     Recently we want to modify the source code, because a very low
score
>> is got when the forecast has little and sporadic precipitation and
the
>> observation has the same case, we think the low sore is not
reasonable. I
>> make the following modification on the code named contable_stats.cc
, it
>> works.
>>
>> Now I have a question about the code named met_stats.cc where the
>> correlation coefficient is computed.
>>
>> The modified code is
>>
>> But there are errors
>>
>> I am not familiar with C++, Can you help me? Look forward to your
>> feedbacks. Your help is highly appreciated.
>>
>>
>>
>> Kind Regards,
>>
>> Crystal
>>
>>
>>
>

------------------------------------------------


More information about the Met_help mailing list