feat: rejiggle default number of samples.

This commit is contained in:
NunoSempere 2022-12-03 13:14:08 +00:00
parent b6addc7f05
commit 94119e0173
4 changed files with 28 additions and 7 deletions

View File

@ -14,7 +14,7 @@ var Epsilon = {
};
var Environment = {
defaultXYPointLength: 1000,
defaultSampleCount: 10000,
defaultSampleCount: 1000000,
sparklineLength: 20
};
var OpCost = {

View File

@ -19,8 +19,8 @@ var Epsilon = {
};
var Environment = {
defaultXYPointLength: 1000,
defaultSampleCount: 10000,
defaultXYPointLength: 1000000,
defaultSampleCount: 1000000,
sparklineLength: 20
};

View File

@ -5,9 +5,22 @@ p_a = 0.8
p_b = 0.5
p_c = p_a * p_b
result = mx([0, 1, 1 to 3, 2 to 10], [(1 - p_c), p_c/2, p_c/4, p_c/4 ])
dist_0 = 0
dist_1 = 1
dist_some = SampleSet.fromDist(1 to 3)
dist_many = SampleSet.fromDist(2 to 10)
dists = [dist_0, dist_1, dist_some, dist_many]
weights = [(1 - p_c), p_c/2, p_c/4, p_c/4 ]
result = mixture(dists, weights)
mean(result)
`
let output = run(squiggle_code)
let output = run(squiggle_code, {
defaultXYPointLength: 1000000,
defaultSampleCount: 1000000,
sparklineLength: 20,
})
console.log(output.result.value)

View File

@ -2,5 +2,13 @@ p_a = 0.8
p_b = 0.5
p_c = p_a * p_b
result = mx([0, 1, 1 to 3, 2 to 10], [(1 - p_c), p_c/2, p_c/4, p_c/4 ])
mean(result)
dist_0 = 0
dist_1 = 1
dist_some = SampleSet.fromDist(1 to 3)
dist_many = SampleSet.fromDist(2 to 10)
dists = [dist_0, dist_1, dist_some, dist_many]
weights = [(1 - p_c), p_c/2, p_c/4, p_c/4 ]
result = mixture(dists, weights)
mean(result)