def test_sens_passed_inp_data(self):
"""Test the sensitivity using provided initial data
"""
data = self.bayes.get_data()
sens_matrix = self.bayes._get_sens(initial_data=data)
indep = np.linspace(1, 11, 5) - data['simple'][2]['tau']
resp_mat = np.array([(1.02 * 2 * indep)**2 + 1 * indep -
(2 * indep)**2 - indep,
(2 * indep)**2 + 1.02 * indep -
(2 * indep)**2 - 1 * indep])
inp_mat = np.array([[0.02 * 2, 0], [0, 0.02]])
true_sens = np.linalg.lstsq(inp_mat, resp_mat)[0].T
npt.assert_array_almost_equal(sens_matrix['simple'], true_sens,
decimal=8,
err_msg='Sens matrix not as predicted')
评论列表
文章目录