usingHypothesisTestsusingGadflyusingDataFramesinclude("Plots/plot_data.jl")diff=acci-accj#Density plot of difference of accuraciesp=plot_data(cl1,cl2,[],diff,-0.03,0.02)display(p)#Compute p-value Sign-Rank Testpval_SignRankTest=pvalue(SignedRankTest(acci,accj))println("p-value=$pval_SignRankTest")#Compute p-value SignTest#pvalSignTest=pvalue(SignTest(acci-accj), tail=:left)#println("p-value=$pvalSignTest")
p-value=1.628439911664703e-6
In [ ]:
Bayesian sign-test
In [8]:
usingDistributionsusingDataFramesusingGadflyusingComposeinclude("Tests/Bsigntest.jl")include("Plots/plot_simplex.jl")#Bayesian Sign Test without roperope=0data=Bsigntest(acci,accj,rope)#Plotdf=DataFrame(Pleft=data[1,:][:])p=plot(df,x=:Pleft,Geom.histogram,Theme(major_label_font_size=13pt,minor_label_font_size=12pt,key_label_font_size=11pt))display(p)draw(PDF("Plots/postSignTestnorope$cl1$cl2.pdf",6inch,3inch),p)#Bayesian Sign Test with roperope=0.01data=Bsigntest(acci,accj,rope)#Plotptriangle=plot_simplex(data,ClassNames[cl1],ClassNames[cl2])display(ptriangle)draw(PDF("Plots/plotSignSimplex$cl1$cl2.pdf",5inch,5inch),ptriangle)#Plot Marginalsdf=DataFrame(Pleft=data[1,:][:],Prope=data[2,:][:])p=plot(df,x=:Pleft,y=:Prope,Geom.histogram2d,Guide.xlabel(ClassNames[cl2]),Guide.ylabel("rope"),Theme(major_label_font_size=13pt,minor_label_font_size=12pt,key_label_font_size=11pt))display(p)draw(PDF("Plots/postSignTestA$cl1$cl2.pdf",6inch,3inch),p)df=DataFrame(Pright=data[3,:][:],Prope=data[2,:][:])p=plot(df,x=:Pright,y=:Prope,Geom.histogram2d,Guide.xlabel(ClassNames[cl1]),Guide.ylabel("rope"),Theme(major_label_font_size=13pt,minor_label_font_size=12pt,key_label_font_size=11pt))display(p)draw(PDF("Plots/postSignTestB$cl1$cl2.pdf",6inch,3inch),p)
Bayesian sign-rank test
In [15]:
usingDistributionsusingDataFramesusingGadflyusingComposeinclude("Tests/Bsignranktest.jl")include("Plots/plot_simplex.jl")#Bayesian Sign-Rank Test without roperope=0.0data=Bsignranktest(acci,accj,rope)df=DataFrame(Pleft=data[1,:][:])p=plot(df,x=:Pleft,Geom.histogram,Theme(major_label_font_size=13pt,minor_label_font_size=12pt,key_label_font_size=11pt))display(p)draw(PDF("Plots/postSignRanknorope$cl1$cl2.pdf",6inch,3inch),p)#Bayesian Sign-Rank Test with roperope=0.01data=Bsignranktest(acci,accj,rope)#Plot Simplexptriangle=plot_simplex(data,ClassNames[cl1],ClassNames[cl2])display(ptriangle)draw(PDF("Plots/plotSignRankSimplex$cl1$cl2.pdf",6inch,5inch),ptriangle)#Plot Marginalsdf=DataFrame(Pleft=data[1,:][:],Prope=data[2,:][:])p1=plot(df,x=:Pleft,y=:Prope,Geom.histogram2d,Guide.xlabel(ClassNames[cl2]),Guide.ylabel("rope"),Theme(major_label_font_size=13pt,minor_label_font_size=12pt,key_label_font_size=11pt))display(p1)draw(PDF("Plots/postSignRankA$cl1$cl2.pdf",6inch,3inch),p1)df=DataFrame(Pright=data[3,:][:],Prope=data[2,:][:])p2=plot(df,x=:Pright,y=:Prope,Geom.histogram2d,Guide.xlabel(ClassNames[cl1]),Guide.ylabel("rope"),Theme(major_label_font_size=13pt,minor_label_font_size=12pt,key_label_font_size=11pt))display(p2)draw(PDF("Plots/postSignRankB$cl1$cl2.pdf",6inch,3inch),p2)