Skip to content

Weighting options (‒w)

Thomas Nipen edited this page May 2, 2017 · 19 revisions

When segments are joined together, the end state of one segment is used to search for a similar starting state. The similarity of two states are gauged using a metric. The metric computes a score for each candidate.

wxgen sim -db database.nc -n 1000 -t 365 -s agg -o unweighted.nc
wxgen sim -db database.nc -n 1000 -t 365 -s agg -w 1,2.5,0.001 -o weighted.nc

Weights apply to the variables in the order they are placed in the database file. This example assigns the weight 1 to the first variable (air_temperature_2m), 2.5 to the second (precipitation_amount), and 0.001 to the third (sea_level_pressure). The weight should be proportional to the inverse of the standard deviation of the variable. The [[units|About-the-ECMWF-db] of the variables are therefore important to know. Since pressure is in Pa, the weight is proportionally smaller than the other variables.

By default, the score is computed by adding the square differences multiplied by the weight for each variable. Check out this wiki page for other metric options.

Example

The weighting reduces jumps between segments at the aggregated scale:

wxgen sim -db database.nc -n 1000 -t 365 -s agg -o unweighted.nc
wxgen sim -db database.nc -n 1000 -t 365 -s agg -w 1,2.5,0.001 -o weighted.nc
wxgen verif noweight.nc weighted.nc -m jump -s agg