ReferenceSpecificationVector

15 views
Skip to first unread message

Sonic

unread,
Sep 16, 2019, 3:22:44 PM9/16/19
to shyft
Hello,

I am working to set up some Shyft simulations following the online documentation.

I note that there are methods for a 'TargetSpecificationVector' in the CalibConfig object, but there does not seem to be anything similar for the 'references'.

Is there a method associated with the Simulator class to calculate the objective function? For example, to know the NSE or KGE values following a simulation, given a reference timeseries?


sigbjorn.helset

unread,
Sep 20, 2019, 4:18:44 AM9/20/19
to shyft
Hi,

Sorry for the delayed response, - there is several ways to compare  two time-series, also regarding the statistical difference.

During calibration you formulate the goal-criteria for the catchment-ids(or river ids), related to discharge, snow swe or snow sca.
The goal criteria function could be NSE,KGE plus some others.

During a calibration we create a calibrator object, that uses the region-model to evaluate the goal-function, using one of the selected goal-seeking algorihtms, min-bobyqa, global search etc.

During that process we also keep track of all the attempts, storing it into an array you can inspect, where the goal-function value along with the parameters are stored.

In addition, you can setup printout (done in the notebook demo's).


Hopefully this would give you all you need regarding goal functions, parameters during calibration process.

In addition, given two time-series, (no model), shyft.time_series gives you:

```python
from shyft.time_series import TimeSeries,TimeAxis,time,Calendar,point_interpretation_policy as ts_fx
import numpy as np

utc=Calendar()
dt=time(3600)
n=365*24
ta=TimeAxis(utc.time(2019,10,1),dt,n)
a=TimeSeries(ta,np.sin(np.linspace(0,n,n)),ts_fx.POINT_AVERAGE_VALUE)
b=TimeSeries(ta,0.7+np.sin(0.23+np.linspace(0,n,n)),ts_fx.POINT_AVERAGE_VALUE)

ns=a.nash_sutcliffe(b)
kg=a.kling_gupta(b,s_r=1.0,s_a=1.0,s_b=1.0)

print(ns,kg)

```

Sonic

unread,
Sep 20, 2019, 5:25:24 PM9/20/19
to shyft
Thank you. 

When using the TargetSpecificationVector, do the 'weights' need to sum to one? Is it a weighting to the discharge (e.g. relative contribution to the total discharge) or is it a weighting to their 'value' in the calculation of NSE/KGE?

sigbjorn.helset

unread,
Sep 22, 2019, 3:02:41 PM9/22/19
to shyft
Hi,

The weights do not need to sum to one. They are normailized in the goal-function evaluation.

Take a look at the code here :

Reply all
Reply to author
Forward
0 new messages