From f1a340fb6859327a99e9a09644aa0ed62620fec1 Mon Sep 17 00:00:00 2001 From: Jia Lu <40996407+alulujasmine@users.noreply.github.com> Date: Thu, 9 Sep 2021 15:57:05 +0800 Subject: [PATCH] Update _chisq.c Update the chisq expression in order to take the condition where the uncert is 2-D i.e. a covariance matrix. In this case, chisq = (data-model).T @ inv(sigma) @ (data-model). --- src_c/_chisq.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src_c/_chisq.c b/src_c/_chisq.c index ce0be85..6d05706 100644 --- a/src_c/_chisq.c +++ b/src_c/_chisq.c @@ -9,6 +9,7 @@ #include "ind.h" #include "stats.h" +#inclue "matrix.h" PyDoc_STRVAR(residuals__doc__, @@ -128,10 +129,17 @@ static PyObject *chisq(PyObject *self, PyObject *args){ dsize = (int)PyArray_DIM(model, 0); /* Calculate model chi-squared: */ - for(i=0; i