Skip to content

Commit

Permalink
Update the test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ShouvikGhosh2048 committed Dec 25, 2022
1 parent 88f2735 commit 433a5d1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions test/numerical/bayesian/LinearRegression.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
mtcars = dataset("datasets", "mtcars")

tests = [
(Prior_Ridge(), 20.094329014886135),
(Prior_Laplace(), 20.070803242904567),
(Prior_Cauchy(), 20.089299279637608),
(Prior_TDist(), 20.07675037883895),
(Prior_HorseShoe(), 20.08147629414915),
(Prior_Ridge(), 20.080877893580514),
(Prior_Laplace(), 20.070783434589128),
(Prior_Cauchy(), 20.019759144845644),
(Prior_TDist(), 20.042614331921428),
(Prior_HorseShoe(), 20.042984550677183),
]

for (prior, test_mean) in tests
Expand All @@ -15,7 +15,7 @@ for (prior, test_mean) in tests
@test mean(predict(model, mtcars)) test_mean
end

gauss_test = 20.077725307634
gauss_test = 20.0796026428345

CRRao.set_rng(StableRNG(123))
model = fit(@formula(MPG ~ HP + WT + Gear), mtcars, LinearRegression(), Prior_Gauss(), 30.0, [0.0,-3.0,1.0], 1000)
Expand Down
40 changes: 20 additions & 20 deletions test/numerical/bayesian/LogisticRegression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ tests = [
(
Prior_Ridge(),
(
(Logit(), 0.7726301574939893),
(Probit(), 0.7718991855077517),
(Cloglog(), 0.7729607868936296),
(Cauchit(), 0.773088648259103)
(Logit(), 0.7690822208626806),
(Probit(), 0.7685999218881091),
(Cloglog(), 0.7751111243871245),
(Cauchit(), 0.7730511118602764)
)
),
(
Prior_Laplace(),
(
(Logit(), 0.7721450629705013),
(Probit(), 0.7700924638261658),
(Cloglog(), 0.7725984571763792),
(Cauchit(), 0.7733539997964879)
(Logit(), 0.7718593681922629),
(Probit(), 0.7695587585010469),
(Cloglog(), 0.7714870967902365),
(Cauchit(), 0.7714839338283468)
)
),
(
Prior_Cauchy(),
(
(Logit(), 0.7490077946647627),
(Probit(), 0.7666419321169409),
(Cloglog(), 0.7630424969124491),
(Cauchit(), 0.7751462774369108)
(Logit(), 0.7678814727043146),
(Probit(), 0.764699194194744),
(Cloglog(), 0.7642369367775604),
(Cauchit(), 0.7692152829967064)
)
),
(
Prior_TDist(),
(
(Logit(), 0.5859376296718818),
(Probit(), 0.7612744071932722),
(Cloglog(), 0.7584442886274094),
(Cauchit(), 0.7715325526207547)
(Logit(), 0.588835403024102),
(Probit(), 0.7635642627091132),
(Cloglog(), 0.7609943137312546),
(Cauchit(), 0.772095066757767)
)
),
(
Prior_HorseShoe(),
(
(Logit(), 0.38795793121702976),
(Probit(), 0.4088010293870976),
(Cloglog(), 0.7662231188565767),
(Cauchit(), 0.7685459396568979)
(Logit(), 0.38683395333332327),
(Probit(), 0.38253233489484173),
(Cloglog(), 0.7667553778881738),
(Cauchit(), 0.7706755564626601)
)
),
]
Expand Down
10 changes: 5 additions & 5 deletions test/numerical/bayesian/NegBinomialRegression.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
sanction = dataset("Zelig", "sanction")

tests = [
(Prior_Ridge(), 6.89333113986786),
(Prior_Laplace(), 6.868506051646364),
(Prior_Cauchy(), 6.871750107984425),
(Prior_TDist(), 6.871687824045264),
(Prior_HorseShoe(), 6.512395375168992),
(Prior_Ridge(), 6.8753100988051274),
(Prior_Laplace(), 6.908332048475347),
(Prior_Cauchy(), 6.9829255933233645),
(Prior_TDist(), 6.915515248823249),
(Prior_HorseShoe(), 6.703023191644206),
]

for (prior, test_mean) in tests
Expand Down
10 changes: 5 additions & 5 deletions test/numerical/bayesian/PoissonRegression.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
sanction = dataset("Zelig", "sanction")

tests = [
(Prior_Ridge(), 7.156569426585206),
(Prior_Laplace(), 7.147034162448096),
(Prior_Cauchy(), 7.160021974618625),
(Prior_TDist(), 7.144672898872307),
(Prior_HorseShoe(), 7.139133430699899),
(Prior_Ridge(), 7.177578002644547),
(Prior_Laplace(), 7.1454141602741785),
(Prior_Cauchy(), 7.148699646242317),
(Prior_TDist(), 7.165968828611132),
(Prior_HorseShoe(), 7.144190707091213),
]

for (prior, test_mean) in tests
Expand Down

0 comments on commit 433a5d1

Please sign in to comment.