I have defined a model and given it parameters (no inference).
If I try to estimate the mutation rate with:
model.fit_within_pop_diversity()
Then I get the following error:
numpy.core._exceptions._UFuncNoLoopError: ufunc 'subtract' did not contain a loop with signature matching types (dtype('float64'), dtype('<U8')) -> None
I dug into this - for line 454 in .../momi/sfs_stats.py we have two variables, self.observed and self.expected .
self.observed is a numpy.float64 but self.expected is a str. Perhaps I gave the model my variables in an unorthodox way.
Of course to fix this all I had to do was:
change line 454 from
(self.observed - self.expected) / self.sd
to
(self.observed - float(self.expected)) / self.sd
My mistake. Indeed I was inputting mu as a string which creates this error. I input it like this because when bootstrapping, I save the inferred parameters to a dict, which loads as a string by default.
I have defined a model and given it parameters (no inference).
If I try to estimate the mutation rate with:
model.fit_within_pop_diversity()
Then I get the following error:numpy.core._exceptions._UFuncNoLoopError: ufunc 'subtract' did not contain a loop with signature matching types (dtype('float64'), dtype('<U8')) -> None
I dug into this - for line 454 in.../momi/sfs_stats.py
we have two variables,self.observed
andself.expected
.self.observed
is a numpy.float64 butself.expected
is a str. Perhaps I gave the model my variables in an unorthodox way.Of course to fix this all I had to do was: change line 454 from
(self.observed - self.expected) / self.sd
to(self.observed - float(self.expected)) / self.sd