flex icon indicating copy to clipboard operation
flex copied to clipboard

`sample` of `Sketch` returns boundary values occasionally

Open xxxnell opened this issue 7 years ago • 3 comments

sample of Sketch returns boundary values (e.g. List(..., -1.3346329812349141E307, 7.927339694866348E307, ..., 4.2420349412446703E307, ..., -1.1082857601763558E308...)).

xxxnell avatar Apr 10 '18 19:04 xxxnell

For Sketch about Std with 100 samples, A samples function returns a list containing more than 10% of values greater than 10.

xxxnell avatar Apr 13 '18 09:04 xxxnell

How to get this issue. I was trying like this and see it fine.

scala> import flip.implicits._ import flip.implicits._

scala> val underlying = NumericDist.normal(0.0, 1.0) underlying: flip.pdf.NormalDist[Double] = NormalDistImpl(Measure,flip.conf.DefaultSmoothDistConf$@3c28372d,0.0,1.0,IRngImpl(1072693248))

scala> val (_, samples) = underlying.samples(100) samples: List[Double] = List(1.5518866496219879, 1.1936023725606515, 0.38080892362529634, -0.1897430357097696, -1.2207970250688067, 0.3486939321155784, 0.29946337913768784, -1.4227208457792881, -0.3944399185780814, -0.424529776725254, 1.2594303581908546, -2.0007737988860717, 0.9260040590622992, 0.5999675344005262, -0.5033634219485902, -1.5636470479025906, -0.5154388439192938, 0.4027120196305333, -0.5281069068747963, 0.7766441736329389, 0.6110166324257643, -0.37067176833033233, -0.9409052800937043, -0.13015739314390917, 0.2629238869734297, 0.6841060012654049, 0.7111724688446545, 2.176873911486755, -0.09522236721506186, 0.21478528742759107, 0.41557787591997564, 1.2754810779776178, -1.9164464400322176, 0.45128971299902565, 0.10765526607948277, -2.168858107407589, ...

ghost avatar Apr 15 '18 11:04 ghost

@hyesubba Thank you for your feedback. I admit that the title of this issue can be misleading. This problem occurs occasionally, so a few values generated from samples can be boundary values. So, I changed the title. Also, this problem is only related to Sketch. Unlike sample of Sketch, sample and samples of NumericDist works properly as you said.

xxxnell avatar Apr 15 '18 12:04 xxxnell