Skip to content

Commit

Permalink
Merge pull request #74 from Vaibhavdixit02/master
Browse files Browse the repository at this point in the history
Fix Turing test
  • Loading branch information
Vaibhavdixit02 committed May 29, 2019
2 parents 61b93cd + 85f3f79 commit 1496b86
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/turing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ priors = [Normal(1.5,0.01)]

bayesian_result = turing_inference(prob1,Tsit5(),t,data,priors;num_samples=500)

@show mean(bayesian_result[:_theta][50:end])
@show bayesian_result

@test mean(bayesian_result[:_theta][50:end])[1] 1.5 atol=0.1
@test mean(bayesian_result.value[:,1,1]) 1.5 atol=0.1

println("Four parameter case")
f2 = @ode_def begin
Expand All @@ -38,9 +38,9 @@ priors = [Truncated(Normal(1.5,0.01),0,2),Truncated(Normal(1.0,0.01),0,1.5),

bayesian_result = turing_inference(prob2,Tsit5(),t,data,priors;num_samples=500)

@show mean(bayesian_result[:_theta][:,:][50:end])
@show bayesian_result

@test mean(bayesian_result[:_theta][:,1][50:end]) 1.5 atol=3e-1
@test mean(bayesian_result[:_theta][:,2][50:end]) 1.0 atol=3e-1
@test mean(bayesian_result[:_theta][:,3][50:end]) 3.0 atol=3e-1
@test mean(bayesian_result[:_theta][:,4][50:end]) 1.0 atol=3e-1
@test mean(bayesian_result.value[:,1,1]) 1.5 atol=3e-1
@test mean(bayesian_result.value[:,2,1]) 1.0 atol=3e-1
@test mean(bayesian_result.value[:,3,1]) 3.0 atol=3e-1
@test mean(bayesian_result.value[:,4,1]) 1.0 atol=3e-1

0 comments on commit 1496b86

Please sign in to comment.