Re: [Jprogramming] Plot a binomial distribution

2016-03-11 Thread Rob Hodgkinson
Hi Devon, try ‘stats’ add-on in Package Manager… load 'stats/base/distribution' load 'plot' plot binomialdist 0.8 20 plot binomialdist 0.2 20 HTH, Rob > On 12 Mar 2016, at 4:09 PM, Devon McCormick wrote: > > Has anyone plotted a binomial distribution in J? Either a histogram, > po

[Jprogramming] Plot a binomial distribution

2016-03-11 Thread Devon McCormick
Has anyone plotted a binomial distribution in J? Either a histogram, point, or line plot? I know there's something in R I can use but I'd like to have a way to do it as well or better in J. Thanks, Devon -- Devon McCormick, CFA Quantitative Consultant

Re: [Jprogramming] A plane rotation

2016-03-11 Thread Donald Kelly
We are trying to do the same thing- where you concentrate on a point- slope approach, I tend to a rotation of points -and there can be many- points on a shape or a curve. With this latest example I use the following. rotheta=:([:r.[)*] pts=:_1j0 0j1 1j2 ctr=:_1j1 ] s=:ctr+ (1r4p1) rotheta

Re: [Jprogramming] Numerator and Denominator

2016-03-11 Thread Martin Kreuzer
Thanks; of course, and together with Ben Gorte's suggestion delivers the wanted result: ] v=. 5+i.4 5 6 7 8 }: ,v ,.($v) # 1 5 1 6 1 7 1 8 -M At 2016-03-11 13:12, you wrote: Would this be helpful?,v,.($v)#1 0 1 1 1 2 1 3 1 Linda -Original Message- From: Programming [mailto:p

Re: [Jprogramming] Unbox request for requests

2016-03-11 Thread Raul Miller
An array of boxes in C is an an array of pointers to arrays with the containing array type being BOX (which jtype.h defines as 32). -- Raul On Thu, Mar 10, 2016 at 5:40 PM, Pascal Jasmin wrote: > This idea has a lot of promise. Converting to and from C structures would be > big, though C doe

Re: [Jprogramming] Interweave

2016-03-11 Thread Raul Miller
There's nothing wrong with "normal order". But you can go only so far, with words. At some point you need to illustrate the concept. Which brings up another problem: the 4 got chopped off the current definition of z in that example: ]z=: 0 10 20 +/ i. NB. sample noun Anyways, if you just s

Re: [Jprogramming] Interweave

2016-03-11 Thread Martin Kreuzer
Thanks, that's pretty obvious now; slightly modified: ] v=. 5 + i.4 5 6 7 8 ] w=. (#v) $ 1 1 1 1 1 ] lne=. }: ,v ,.w NB. either curtail ... 5 1 6 1 7 1 8 ] lne=. }. ,w ,.v NB. or behead 5 1 6 1 7 1 8 I must always remind myself that we are talking arrays (lists), so the loop I had

Re: [Jprogramming] Numerator and Denominator

2016-03-11 Thread Linda A Alvord
Would this be helpful? ,v,.($v)#1 0 1 1 1 2 1 3 1 Linda -Original Message- From: Programming [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Martin Kreuzer Sent: Friday, March 11, 2016 7:30 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Numerator and Den

Re: [Jprogramming] Numerator and Denominator

2016-03-11 Thread Martin Kreuzer
btw (and as expected) D.E. Knuth, The Art of Computer Programming, 2nd, vol 2, pages 339 ff uses this convention as a shorthand to describe a regular continued fraction: / x1, x2, ...,xn / like in these examples 8/29 = / 3, 1, 1, 1, 2 / e = 2 + / 1, 2, 1, 1, 4, 1, 1, 6, 1,... / -M At 2016-03-10

Re: [Jprogramming] Interweave

2016-03-11 Thread Ben Gorte - CITG
> How would one go about throwing in the additional "1"s into the > spaces (gaps) of the paling fence..? (There is one less "1" compared > to the number of integers in the "list notation" [if I always write > out the integer part, even if it is "0"). > > If the two lists I like to "interweave" don'

Re: [Jprogramming] Interweave

2016-03-11 Thread Martin Kreuzer
@ Linda Alvord: Sorry for accidentally misprinting your last anme ... -M At 2016-03-11 08:17, you wrote: J does it this way: g=: 13 :',x,.y'g [: , ,. Linda -Original Message- From: Programming [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Roger Hui Sent: Thursday,

Re: [Jprogramming] Interweave

2016-03-11 Thread Martin Kreuzer
Trying to word the question which originally came to mind when I looked at this problem (converting the "list notation" of a c.f.) to a decimal value: How would one go about throwing in the additional "1"s into the spaces (gaps) of the paling fence..? (There is one less "1" compared to the nu

Re: [Jprogramming] Interweave

2016-03-11 Thread Martin Kreuzer
To keep students organized in dealing with fractions I sometimes (on a good day) have them work out intermediate results of continued fractions like phi = [1; 1, 1, 1, ...] or sqrt(2) = [1; 2, 2, 2, ...]. This example I found at http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/cfINT

Re: [Jprogramming] Interweave

2016-03-11 Thread Linda A Alvord
Maybe... The new list interweaves the two original lists. The "strategy" also applies to lists of numbers. Linda -Original Message- From: Programming [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Henry Rich Sent: Thursday, March 10, 2016 6:58 PM To: programm...@jsoftwa

Re: [Jprogramming] Interweave

2016-03-11 Thread Linda A Alvord
J does it this way: g=: 13 :',x,.y' g [: , ,. Linda -Original Message- From: Programming [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Roger Hui Sent: Thursday, March 10, 2016 5:49 PM To: Programming forum Subject: Re: [Jprogramming] Interweave ,'ace',.'bdf' abcd