|
|
|
@ -8,6 +8,11 @@ import (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type src = *rand.Rand
|
|
|
|
|
type IntProbability {
|
|
|
|
|
N int64
|
|
|
|
|
p float64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type pplKnownDistrib = map[int64]float64
|
|
|
|
|
|
|
|
|
|
func generatePeopleKnownDistribution(r src) map[int64]float64 {
|
|
|
|
@ -120,7 +125,7 @@ func draw148PplFromDistributionAndCheck(d pplKnownDistrib, r src, show bool) int
|
|
|
|
|
|
|
|
|
|
func getUnnormalizedBayesianUpdateForDistribution(d pplKnownDistrib, r src) int64 {
|
|
|
|
|
var sum int64 = 0
|
|
|
|
|
n := 100
|
|
|
|
|
n := 1000
|
|
|
|
|
for i := 0; i < n; i++ {
|
|
|
|
|
/* if i%1000 == 0 {
|
|
|
|
|
fmt.Println(i)
|
|
|
|
@ -137,6 +142,7 @@ func main() {
|
|
|
|
|
var r = rand.New(rand.NewPCG(uint64(1), uint64(2)))
|
|
|
|
|
|
|
|
|
|
sum := int64(0)
|
|
|
|
|
distribs := [](int64, pplKnownDistrib){}
|
|
|
|
|
for i := 0; i < 1000; i++ {
|
|
|
|
|
|
|
|
|
|
people_known_distribution := generatePeopleKnownDistribution(r)
|
|
|
|
@ -146,6 +152,7 @@ func main() {
|
|
|
|
|
if result > 0 {
|
|
|
|
|
fmt.Println(people_known_distribution)
|
|
|
|
|
fmt.Println(result)
|
|
|
|
|
distribs.append()
|
|
|
|
|
}
|
|
|
|
|
sum += result
|
|
|
|
|
// fmt.Println(result)
|
|
|
|
|