我正在尝试使用 pymc3 来拟合涉及 voigt 函数的模型(来自 scipy.special)。voigt 函数的输入应该是数组,而 a,b 是 pymc3 类。如何获得 scipy.special 函数以将 pymc3 RV 作为输入?运行下面附加的代码会产生错误:
import pymc3 as pm
from scipy.special import voigt_profile
import numpy as np
with pm.Model() as linear_model:
a = pm.Lognormal('a',mu=0, sigma=2.)
b = pm.Lognormal('b',mu=0, sigma=2.)
x = np.linspace(-1,1)
c = voigt_profile(x,a,b)
TypeError: ufunc 'voigt_profile' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
慕哥9229398
哔哔one
随时随地看视频慕课网APP
相关分类