使用近似贝叶斯标准的 LoadError
LoadError using approximate bayesian criteria
我收到一个令我困惑的错误。
using DifferentialEquations
using RecursiveArrayTools # for VectorOfArray
using DiffEqBayes
f2 = @ode_def_nohes LotkaVolterraTest begin
dx = x*(1 - x - A*y)
dy = rho*y*(1 - B*x - y)
end A B rho
u0 = [1.0;1.0]
tspan = (0.0,10.0)
p = [0.2,0.5,0.3]
prob = ODEProblem(f2,u0,tspan,p)
sol = solve(prob,Tsit5())
t = collect(linspace(0,10,200))
randomized = VectorOfArray([(sol(t[i]) + .01randn(2)) for i in 1:length(t)])
data = convert(Array,randomized)
priors = [Uniform(0.0, 2.0), Uniform(0.0, 2.0), Uniform(0.0, 2.0)]
bayesian_result_abc = abc_inference(prob, Tsit5(), t, data,
priors;num_samples=500)
Returns 错误
ERROR: LoadError: DimensionMismatch("first array has length 400 which does not match the length of the second, 398.")
while loading..., in expression starting on line 20.
我找不到任何大小为 400 或 398 的数组。
感谢您的帮助。
查看 https://github.com/JuliaDiffEq/DiffEqBayes.jl/issues/52,这是由于传递 t
时出错。这已在 master 上修复,因此您可以使用它或等待一段时间,我们将很快发布一个新版本,其中包含 1.0 升级,也将修复此问题。
谢谢!
我收到一个令我困惑的错误。
using DifferentialEquations
using RecursiveArrayTools # for VectorOfArray
using DiffEqBayes
f2 = @ode_def_nohes LotkaVolterraTest begin
dx = x*(1 - x - A*y)
dy = rho*y*(1 - B*x - y)
end A B rho
u0 = [1.0;1.0]
tspan = (0.0,10.0)
p = [0.2,0.5,0.3]
prob = ODEProblem(f2,u0,tspan,p)
sol = solve(prob,Tsit5())
t = collect(linspace(0,10,200))
randomized = VectorOfArray([(sol(t[i]) + .01randn(2)) for i in 1:length(t)])
data = convert(Array,randomized)
priors = [Uniform(0.0, 2.0), Uniform(0.0, 2.0), Uniform(0.0, 2.0)]
bayesian_result_abc = abc_inference(prob, Tsit5(), t, data,
priors;num_samples=500)
Returns 错误
ERROR: LoadError: DimensionMismatch("first array has length 400 which does not match the length of the second, 398.")
while loading..., in expression starting on line 20.
我找不到任何大小为 400 或 398 的数组。 感谢您的帮助。
查看 https://github.com/JuliaDiffEq/DiffEqBayes.jl/issues/52,这是由于传递 t
时出错。这已在 master 上修复,因此您可以使用它或等待一段时间,我们将很快发布一个新版本,其中包含 1.0 升级,也将修复此问题。
谢谢!