fengshui
This commit is contained in:
parent
b0f48286d5
commit
5b52cf3297
10
f.go
10
f.go
|
@ -171,7 +171,7 @@ func multiplyAsSamples(dist1 Dist, dist2 Dist) Dist {
|
|||
zs[i] = xs[i] * ys[i]
|
||||
}
|
||||
|
||||
fmt.Printf("%v\n", zs)
|
||||
// fmt.Printf("%v\n", zs)
|
||||
return FilledSamples{xs: zs}
|
||||
}
|
||||
|
||||
|
@ -239,7 +239,7 @@ func joinDists(old_dist Dist, new_dist Dist, op string) (Dist, error) {
|
|||
}
|
||||
|
||||
/* Pretty print distributions */
|
||||
func prettyPrint90CI(low float64, high float64) {
|
||||
func prettyPrint2Floats(low float64, high float64) {
|
||||
// fmt.Printf("=> %.1f %.1f\n", low, high)
|
||||
switch {
|
||||
case math.Abs(low) >= 1_000_000_000_000:
|
||||
|
@ -278,7 +278,7 @@ func prettyPrintDist(dist Dist) {
|
|||
switch v := dist.(type) {
|
||||
case Lognormal:
|
||||
fmt.Printf("=> ")
|
||||
prettyPrint90CI(v.low, v.high)
|
||||
prettyPrint2Floats(v.low, v.high)
|
||||
case FilledSamples:
|
||||
tmp_xs := make([]float64, N_SAMPLES)
|
||||
copy(tmp_xs, v.xs)
|
||||
|
@ -289,10 +289,10 @@ func prettyPrintDist(dist Dist) {
|
|||
low := tmp_xs[low_int]
|
||||
high_int := N_SAMPLES * 19 / 20
|
||||
high := tmp_xs[high_int]
|
||||
prettyPrint90CI(low, high)
|
||||
prettyPrint2Floats(low, high)
|
||||
case Beta:
|
||||
fmt.Printf("=> beta ")
|
||||
prettyPrint90CI(v.a, v.b)
|
||||
prettyPrint2Floats(v.a, v.b)
|
||||
default:
|
||||
fmt.Printf("%v", v)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user