bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in WS 1 STAT


From: Bill Daly
Subject: Re: Bug in WS 1 STAT
Date: Sat, 21 Dec 2019 09:34:29 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1

Fixed. Try git clone https://git.code.sf.net/p/apl-library/code apl-library-code


w


On 12/20/19 1:33 PM, Mr. Brian B. McGuinness wrote:
Looking through the functions in workspace 1 STAT I noticed that stat∆skewness calls stat∆pearson with no argument (under line label "four"):


∇skewness←stat∆pearson vector;mm;md;sd
  ⍝ Function returns the Pearson coefficient of skewness
  mn←stat∆mean vector←,vector
  md←stat∆median vector
  sd←stat∆sampleSD vector
  skewness←(3×mn-md)÷sd


∇ skew←type stat∆skewness vector;n;var;sq
  ⍝ Function returns a measure of skewness
  ⍎(0=⎕nc 'type')/'type←1'
  type←4⌊type
  n←stat∆count vector
  var←vector - stat∆mean vector
  skew←(n*.5)×(+/var*3)÷(+/var*2)*3÷2
  →(one,two,three,four)[type]
one:
  →end
two:
  ⎕es (n<3)/'At least three observations are required.'
  skew←skew ×  ((n × ( n -1))*.5)÷n - 2
  →end
three:
  skew←skew×(1-1÷n)*3÷2
  →end
four:
  skew←stat∆pearson
  →end
end:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]