save
x.k
abc
+
◀
▶
/leading comments in x.k show up as help text /click on the example functions in the top row: / rowcount: show number of rows from table A / countsel: show the number of selected rows (once clicked it's re-evaluated after each new selection) / xy : plot a column as a timeseries in an xy diagram and the moving average as a second line. / it returns a dict with statistics shown below the plot. / square : keep the axes square / polar : plot complex values in a polar diagram. only selected rows are included. update the plot by selecting other rows. / ampang : shows amplitude/phase and a polar diagram side-by-side / tby : plot table with lines grouped by class, returns an aggregated keytable /click or double-click on x.k to edit code mavg:{(y-(-#y)#(-x)_y:+\y)%x} mmax:{while[x-:1;y:{x|(*x),-1_x}y];y} mmin:{while[x-:1;y:{x&(*x),-1_x}y];y} avg:{(+/x)%0.+#x} var:{(+/x*x:(x-avg x))%-1+#x} std:{%var x} med: **|2^^ r95:{1.97*(((std@_x)^b)+(std imag x)^b)^1%b:3.2} fit:{n:#x;u:+/x*x;v:+/x*y;((u*y)-x*v;(n*v)-x*y:+/y)%(n*u)-x*x:+/x} /(a;b) line-fit y:a+b*x wbl:{(-10|log x;log log 1%1-cdf:(-1_(1+!n)*d),1-0.5*d:1.%n:#x:^x)} /(X;Y) weibull transform qwbl:{[p;k;l]l*(-log 1-p)^1%k} /quantile for p from k l klwbl:{[XY]ab:fit.XY;(k;exp(-*ab)%k:ab 1)} wblplot:{plot xy:wbl x;+`shape`scale`q95!,'kl,(qwbl 0.95).kl:klwbl xy} idx:{[a;u]solve[(1@0.+a;1a0+a);u]} /(nominal;offset) idxplot:{[t;i;sa;su]o:*|r:idx[a:0.+t sa;u:t su];q:*r;plot'(i;">>-",(#u)#"o";``,su;`polar;0a,o;o,o+q;o+q*1a@a;,'u);+(,su)!,r} cal:{[s;t]+-1_'solve[+t,'1a;+s]} /least squares, e.g. A:(3 5 -8 12.;-2 3 3 0.;7 -8 2 1.);b:dot[+A;x:1 2 3];0.00001>|/abs x-solve[A;b] /A:list of columns dot: (+/*)\ qr: {K:!m:#*x;I:!n:#x;j:0;r:n#0a;turn:$[`Z~@*x;{(-x)@angle y};{x*1. -1@y>0}];while[j
✖