def rsq(self, tmin=None, tmax=None):
"""Correlation between observed and simulated series.
Notes
-----
For the calculation of this statistic the corrcoef method from numpy
is used.
>>> np.corrcoef(sim, obs)[0, 1]
Please refer to the Numpy Docs:
https://docs.scipy.org/doc/numpy/reference/generated/numpy.corrcoef.html#numpy.corrcoef
"""
sim = self.ml.simulate(tmin=tmin, tmax=tmax)
obs = self.ml.observations(tmin=tmin, tmax=tmax)
sim = sim[obs.index] # Make sure to correlate the same in time.
return np.corrcoef(sim, obs)[0, 1]
评论列表
文章目录