tweak sample size

This commit is contained in:
NunoSempere 2024-02-25 17:33:05 -03:00
parent 78d0c7da87
commit c1c47966c2

View File

@ -108,8 +108,11 @@ func draw148PplFromDistributionAndCheck(d pplKnownDistrib, r src) int64 {
func getUnnormalizedBayesianUpdateForDistribution(d pplKnownDistrib, r src) float64 { func getUnnormalizedBayesianUpdateForDistribution(d pplKnownDistrib, r src) float64 {
var sum int64 = 0 var sum int64 = 0
n := 1_000 n := 100_000
for i := 0; i < n; i++ { for i := 0; i < n; i++ {
if i%1000 == 0 {
fmt.Println(i)
}
sum += draw148PplFromDistributionAndCheck(d, r) sum += draw148PplFromDistributionAndCheck(d, r)
} }
return float64(sum) / float64(n) return float64(sum) / float64(n)
@ -120,6 +123,7 @@ func main() {
var r = rand.New(rand.NewPCG(uint64(1), uint64(2))) var r = rand.New(rand.NewPCG(uint64(1), uint64(2)))
people_known_distribution := generatePeopleKnownDistribution(r) people_known_distribution := generatePeopleKnownDistribution(r)
fmt.Println(people_known_distribution)
/* for i, p := range people_known_distribution { /* for i, p := range people_known_distribution {
fmt.Print64f("%d: %.4f\n", i, p) fmt.Print64f("%d: %.4f\n", i, p)
} */ } */