The manual method I learned is captured in the following formula.
load'stats/base'
midpt
-:@<:@#
median
-:@(+/)@((<. , >.)@midpt { /:~)
iqr=:((median@{.~-@>.@midpt)-(median@{.~>.@midpt))@/:~
--
(B=)
--
For informat
For summarizing a data set use
En=: 4 : 0 NB. tombola-resume
y=.x*(+/%#)(,y)^/1+i.x
e=.1
for_i. 1+i.x do.
e=.e,~i%~+/(_1^i.i)*e*i{.y
end.
_1&x:|.->{:p. e
)
The function 1&En is the mean value.
2&En is the mean value plus or minus the standard deviation.
3&En is 3 numbers summarizing the da
It's perhaps worth noting that these do not always yield the same result:
q2 5 7 11 13
6
q3 5 7 11 13
4
FYI,
--
Raul
On Sun, Feb 21, 2021 at 6:10 PM xash wrote:
>
> Without I.:
> q2=: (1r4 3r4 <.@* #) -/@:{ \:~
>
> And a fun one:
> q3=: \:~ -&({~ # <.@% 4:) /:~
> ---
is it? why would J make an exception here?
actually, I’ve been using at least %~ more frequently than %
I understand that it may be too bad (late?) changing it
now that the J community got used to even J adopting
this convention. But it wouldn’t/shouldn’t have been
of concern when crafting the lang
Without I.:
q2=: (1r4 3r4 <.@* #) -/@:{ \:~
And a fun one:
q3=: \:~ -&({~ # <.@% 4:) /:~
--
For information about J forums see http://www.jsoftware.com/forums.htm
The principle of 'control' v 'data' is one I inferred from the
language. Unfortunately there are exceptions: (x - y), (x % y), and (x
^ y) should be defined the other way, but the pull of convention is just
too strong. And (x e. y), where the exception came by way of Ken's own
work.
Henry R
Directly derived from your version:
q=: 3 : '(-/@:{~ 3r4 1r4 I.~ #\ % #) /:~y'
Didn’t test it, though.
Am 21.02.21 um 22:19 schrieb Emir U:
> q=: 3 : '-/(((1+ i. #y) % #y) I. 0.75 0.25) {/:~y'
--
--
mail written using NEO
neo-layout.org
-
Well explained. I’ve seen this explanation a couple of times here,
but not as much in the documentation (or did I always ignore it?)
So I think that’s something beginners shouldn’t be taught much later
than the rtl processing.
It does make you wonder less about what goes where with many primitives.
I couldn't find this in the archive so here is an attempt at a fairly simple
interquartile range function for those who might be looking for it.
iqr=: 3 : 0
q=: 3 : '-/(((1+ i. #y) % #y) I. 0.75 0.25) {/:~y'
q "1 |: y
)
Pretty certain it can be written much more concisely: just not by me righ
Your argument is unconvincing to me.
J generally processes right to left: agreed.
J has a principle for deciding which argument of a verb should be on the
left: the more 'control-like' argument. The right argument is more
'data-like'. You apply the control argument to the data.
Thus, (x |
I have a question about your proposal:
7 ] F:: see_arg 1 2 3 4
4 7
3 11
2 14
1 16
11 14 16 17
The right to left folds pass arguments in a right to left fashion.
But why should this be the case for a left to right fold?
(I am trying to understand why a left to right fold should be
intuitively
Hi!
I am glad that in version 9.02 verbs are now executed from right to left,
which corresponds to the logic of J.
However, in my opinion, the order of passing arguments to the right verb
(see_arg in my example)
also needs to be changed for the logic of J.
see_arg =: dyad : 0
NB. See argume
On Sun, 21 Feb 2021 07:28:44 -0600, Julian Fondren
wrote:
> There's " https://code.jsoftware.com/wiki/Vocabulary/quotem
> Common use #2, to make a constant verb out of a noun.
>
> (_."_)`2:`3:@.] i:2
> 2 3 _. 2 3
Hi Julian,
thanks for the hint! This does exactly what I was looking for.
R
A blunder of mine some releases ago caused the sentence following
assert. to be executed even if 0=9!:34'' . That will be fixed in the
next beta. The entire sentence, not just the result, should be ignored.
Henry Rich
--
This email has been checked for viruses by AVG.
https://www.avg.com
---
33j15":1j1
1.000
":1j1
1j1
It looks like that's an issue with the dyadic form of ":
(Using anything larger than j15 for the left argument of ": is rarely
wise, unless you're working with exact or rational numeric types.)
Thanks,
--
Raul
On Sun, Feb 21, 2021 a
A different issue - ": ignores the imaginary part of a number.
33j30":1j1
1.00
On Sun, Feb 21, 2021 at 3:55 AM Raul Miller wrote:
> Ok, let's walk through this.
>
> First, let's extract the J's binary representation of pi:
>' '-.~":(64#2)#:256x#.|.a.i.2(3!:5) o.
Here is small tweak that seems to make a big difference to both the memory
consumed and performance:
From this:
ed=: 4 : 0
row=. 4 : '+/ *: (x - (|: y))'
> (row & y) each < "1 x
)
to this:
ed=: 4 : 0 NB. Euclidean distance
row=. +/ @: *: @: (- & (|: y))
> row each < "1 x
)
The row func
There's " https://code.jsoftware.com/wiki/Vocabulary/quotem
Common use #2, to make a constant verb out of a noun.
(_."_)`2:`3:@.] i:2
2 3 _. 2 3
On 2021-02-21 06:28, Thomas Bulka wrote:
Hello everyone,
here's what I want to do: I want to use @. on a gerund like this:
interesting_verb =: f
Hello everyone,
here's what I want to do: I want to use @. on a gerund like this:
interesting_verb =: f`g`2:`3:@.h
h, obviously, is a verb which generates an integer between 0 and 3. However -
I'd like to have a case in which _. is returned on some inputs by my verb.
While it is possible to ha
Hey xash, your versions looks great. Very nice and concise and performant too
but it doesn't seem to work if there's only 1 record on the left hand side. Emir
--
For information about J forums see http://www.jsoftware.com/forums.h
Ok, let's walk through this.
First, let's extract the J's binary representation of pi:
' '-.~":(64#2)#:256x#.|.a.i.2(3!:5) o.1
01001001001110110101010001000110110100011000
To interpret this, let's refer to the wikipedia page on this numeric format:
https://en.wikipedia.org/
21 matches
Mail list logo