Skip to content

Weighting options (‒w)

cristianlussana edited this page Nov 10, 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 db.nc -n 21 -t 365 -v 0,1,2 -w 1,2.5,0.001 -o weighted.nc

First of all, the -v 0,1,2 selects which variables to use in the simulation (which are indexed based on the order they appear in the database, in this case the first three, which are temperature, precipitation, and sea level pressure. if -v is not specified, then all variables are used.)

The -w 1,2.5,0.001 are weights that apply to the selected variables (in that order). In this example, the weight 1 is given to air temperature, 2.5 to precipitation, and 0.001 to sea level pressure. The weight should be proportional to the required precision (i.e. inverse of the standard deviation) of the variable. The units of the variables are therefore important to know. Since sea level 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

A good set of weighting options will reduce jumps between segments at the aggregated scale. The diagram shows that the average absolute change in temperature is larger between day 8 and 9, than between any other pairs of consecutive days. The transition from day 8 to 9 corresponds to the time when a new segment is attached to a previous segment.

wxgen sim -db db_agg.nc -n 1000 -t 365 -w 0 -o unweighted.nc
wxgen sim -db db_agg.nc -n 1000 -t 365 -w 1 -o weighted.nc
wxgen verif unweighted.nc weighted.nc -m jump -tm 9