NB. The essential five functions for Sample Calculus NB. ------------------------------------------------ sample =: ,@({.@] + (%~ (}. -})) */ (i.@(1: + [))) d =: }. - } mids =: -: @ }. + }: S =: 0: , +/\ sum =: +/ A plot function is supplied with J4.05 and is accessible with: load 'plot' It may also be convenient to load 'trig numeric' and to define the verbs vs =: ;~ and=: ,. NB. ------------------------------------------------ NB. the first three of which could have been defined using: NB. first =. {. NB. of =. @ NB. right =. ] NB. left =. [ NB. h =. %~ d NB. indices=. i. of (1: + left) NB. half =. -: NB. behead =. }. NB. curtail =. }: NB. list=. , NB. with: NB. sample=. list of ((first of right) + h */ indices) NB. d =. behead - curtail NB. mids =. half of (behead + curtail) NB.-----------------------------------------------------------