I have a simple model for which I have single data to be used in inference. I’m new to julia. Right now I’m setting up inference using turing.jl .
My Turing model looks like this :
@model function fit_(data1, prob)
# Prior distributions.
α ~ Uniform(0,0.1)
β ~ Uniform(0,0.1)
p = [ α, β]
prob = remake(problem, p=p)
predicted = solve(prob, Tsit5(), saveat=1)'
for i in 1:6
data1[:,i] .~ MvNormal(predicted[:,i], σ^2 * I)
end
return nothing
end
model = fit_(z1 , problem)
Do you guys think its a correct approach ? because model is simple and I inferred same model in r but here i'm not getting correct fitting except for first state in my model.
Model:
function new_model(du, u, p, t)
x, s, a = u
α, β = p
du[1] = - (α * x * s)
du[2] = β * x * s
du[3] = 0
end
# true parameters these are random parameters for setting up problem
p = [0.5, 0.2]
# initial state values
u0 = [20, 3, 2]
problem = ODEProblem(new_model, u0, (0.0,10.0), p)