Dummy

Baysig documentation: Baysig plots

Plots can be embedded in Baysig documents generated on BayesHive. To generate a plot, put a value of a Plot type in a question block, for instance:

 Here is my plot

 ?> distPlot (normal 0 1)

 Thanks for watching!

In the following sections, we describe the different ways to create and manipulate Plot values.

Fundamental plots

There are a number of functions that take data of different types and turn them into plots

Distribution histograms

distPlot takes a distribution over real numbers and returns a histogram plot.

The hitogram plots give you a small input control to set the number of bins. This can be dynamically changed by the user.

distPlot (normal 0 1)

Data histograms

histogram takes a list of numbers (real or integers) as its argument and returns a histogram plot

fromTo 1 10 ⇒ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
1 2 3 4 5 6 7 8 9 10
histogram (fromTo 1 10)

Scatter plots

scatterPlot takes a list of pairs of numbers (either of which can be real or integers) and creates a scatter plot using the pairs as coordinates (as is conventional, the first pair component is plotted on the x-axis and the second on the y-axis).

xyData = zipWithNats (linspace 0 10 8) 1
xyData ⇒ [(1,0.0000), (2,1.2500), (3,2.5000), (4,3.7500), (5,5.0000), (6,6.2500), (7,7.5000), (8,8.7500)]
[ {"x": 1,"y":0},{"x": 2,"y":1.25},{"x": 3,"y":2.5},{"x": 4,"y":3.75},{"x": 5,"y":5},{"x": 6,"y":6.25},{"x": 7,"y":7.5},{"x": 8,"y":8.75} ]
scatterPlot xyData

Signal plots

sigPlot plots a timeseries from a value of type Real->Real.

We Solve a simple differential equation to generate data for this example, but you can also use uploaded timeseries.

dt = 0.1
tmax = 10
s_0 = 1.0
D s t = - s t
0, 1 0.1, 0.9 0.2, 0.81 0.30000000000000004, 0.7290000000000001 0.4, 0.6561000000000001 0.5, 0.5904900000000001 0.6000000000000001, 0.531441 0.7000000000000001, 0.4782969 0.8, 0.43046721 0.9, 0.387420489 1, 0.3486784401 1.1, 0.31381059609 1.2000000000000002, 0.282429536481 1.3, 0.2541865828329 1.4000000000000001, 0.22876792454961 1.5, 0.20589113209464902 1.6, 0.1853020188851841 1.7000000000000002, 0.16677181699666568 1.8, 0.15009463529699912 1.9000000000000001, 0.1350851717672992 2, 0.12157665459056928 2.1, 0.10941898913151235 2.2, 0.09847709021836111 2.3000000000000003, 0.088629381196525 2.4000000000000004, 0.0797664430768725 2.5, 0.07178979876918525 2.6, 0.06461081889226672 2.7, 0.05814973700304005 2.8000000000000003, 0.052334763302736044 2.9000000000000004, 0.047101286972462436 3, 0.042391158275216195 3.1, 0.03815204244769457 3.2, 0.034336838202925116 3.3000000000000003, 0.030903154382632605 3.4000000000000004, 0.027812838944369346 3.5, 0.02503155504993241 3.6, 0.022528399544939168 3.7, 0.02027555959044525 3.8000000000000003, 0.018248003631400726 3.9000000000000004, 0.016423203268260654 4, 0.014780882941434589 4.1000000000000005, 0.01330279464729113 4.2, 0.011972515182562017 4.3, 0.010775263664305815 4.4, 0.009697737297875235 4.5, 0.00872796356808771 4.6000000000000005, 0.00785516721127894 4.7, 0.007069650490151046 4.800000000000001, 0.006362685441135941 4.9, 0.005726416897022347 5, 0.005153775207320112 5.1000000000000005, 0.0046383976865881004 5.2, 0.0041745579179292905 5.300000000000001, 0.0037571021261363613 5.4, 0.0033813919135227254 5.5, 0.003043252722170453 5.6000000000000005, 0.002738927449953408 5.7, 0.0024650347049580672 5.800000000000001, 0.0022185312344622605 5.9, 0.0019966781110160345 6, 0.0017970102999144309 6.1000000000000005, 0.0016173092699229878 6.2, 0.001455578342930689 6.300000000000001, 0.0013100205086376202 6.4, 0.001179018457773858 6.5, 0.0010611166119964723 6.6000000000000005, 0.0009550049507968251 6.7, 0.0008595044557171426 6.800000000000001, 0.0007735540101454283 6.9, 0.0006961986091308855 7, 0.0006265787482177969 7.1000000000000005, 0.0005639208733960172 7.2, 0.0005075287860564154 7.300000000000001, 0.0004567759074507739 7.4, 0.0004110983167056965 7.5, 0.00036998848503512683 7.6000000000000005, 0.00033298963653161415 7.7, 0.00029969067287845274 7.800000000000001, 0.00026972160559060745 7.9, 0.0002427494450315467 8, 0.00021847450052839203 8.1, 0.00019662705047555283 8.200000000000001, 0.00017696434542799753 8.3, 0.00015926791088519777 8.4, 0.00014334111979667798 8.5, 0.0001290070078170102 8.6, 0.00011610630703530917 8.700000000000001, 0.00010449567633177826 8.8, 0.00009404610869860043 8.9, 0.00008464149782874038 9, 0.00007617734804586634 9.1, 0.0000685596132412797 9.200000000000001, 0.00006170365191715173 9.3, 0.00005553328672543656 9.4, 0.0000499799580528929 9.5, 0.000044981962247603614 9.600000000000001, 0.00004048376602284325 9.700000000000001, 0.00003643538942055893 9.8, 0.00003279185047850304 9.9, 0.000029512665430652733 10, 0.00002656139888758746
sigPlot s

Probabilistic signals, points and lines

psigPlot is the probabilistic equivalent of sigPlot which takes a probability distribution over timeseries instead of a single value. Let's plot the wiener distribution over Wiener processes:

-0.1, 0 0, -0.7120543228156393 0.1, 0.17257807669227843 0.20000000000000004, 0.7700639627077295 0.30000000000000004, 1.1069897775324424 0.4, 1.3736811943351879 0.5000000000000001, 0.8145330350330436 0.6000000000000001, 0.5169496559715003 0.7000000000000001, 0.323119763816473 0.8, 0.49894121629807264 0.9, 0.5006320398599082 1, 0.20219608436303443 1.1, 0.435500939318722 1.2, 0.5608243486071653 1.3, 1.1143490861524818 1.4, 1.460177106652859 1.5, 1.5107380684411351 1.6, 1.0095020848295917 1.7, 1.0575830659586978 1.8, 0.9619536385502108 1.9, 0.7869998423240216 2, 1.2619669769099495 2.1, 1.3477059000416394 2.2, 1.0590251572703075 2.3000000000000003, 1.1180636945391529 2.4, 1.2168548875430845 2.5, 1.4929692740721907 2.6, 1.6800890122949381 2.7, 1.6865495095435756 2.8000000000000003, 1.7195541371817091 2.9, 2.1006426785870578 3, 1.736994448313523 3.1, 1.491432252957062 3.2, 1.4851021336768033 3.3000000000000003, 1.8626950812032497 3.4, 1.9589996863623858 3.5, 2.0077119920693223 3.6, 1.9486886273222555 3.7, 1.3560673523275857 3.8000000000000003, 1.1816149149257018 3.9, 1.6612641641692238 4.000000000000001, 1.9182557338593549 4.1000000000000005, 1.716549633220784 4.2, 1.946966190769547 4.300000000000001, 2.6336504608629308 4.4, 1.840140761405076 4.500000000000001, 1.6258597368176515 4.6000000000000005, 1.8325978913814907 4.700000000000001, 2.116067237589016 4.800000000000001, 2.2042504442894146 4.9, 2.169050798731848 5.000000000000001, 2.1933004623836925 5.1000000000000005, 2.4189709332380414 5.200000000000001, 2.809681162267116 5.300000000000001, 2.8412248766852595 5.4, 2.912723052589742 5.500000000000001, 2.711588913961821 5.6000000000000005, 3.3895173839960693 5.700000000000001, 3.2401090124471397 5.800000000000001, 3.3464370145633913 5.9, 2.9626785791110164 6.000000000000001, 3.0655376719294907 6.1000000000000005, 2.6002686861761384 6.200000000000001, 2.6644392225739653 6.300000000000001, 2.962214933237144 6.4, 3.499062810374702 6.500000000000001, 3.872233167461265 6.6000000000000005, 4.062740355837188 6.700000000000001, 4.190568967855084 6.800000000000001, 4.515246257904851 6.9, 4.253186976962096 7.000000000000001, 4.480856991698754 7.1000000000000005, 4.510009084314697 7.200000000000001, 4.434198638925287 7.300000000000001, 4.094196399324837 7.4, 4.195289759068656 7.500000000000001, 4.140592970285655 7.6000000000000005, 4.136272246147253 7.700000000000001, 4.080712358341793 7.800000000000001, 4.159407388716844 7.9, 4.315857806004547 8, 3.9978323441271963 8.100000000000001, 3.9149889902317137 8.200000000000001, 3.8910743601664337 8.3, 3.7524325071333053 8.4, 4.381617333298845 8.5, 4.578182165458742 8.600000000000001, 4.508024562903981 8.700000000000001, 4.646387493929762 8.8, 4.6511392208938585 8.9, 4.499703475976274 9, 4.317667861112171 9.100000000000001, 4.289179901107613 9.200000000000001, 3.9555533263156213 9.3, 3.443274957417047 9.4, 3.618323703308215 9.500000000000002, 3.769612036329692 9.600000000000001, 3.8127528061784752