Talk:Simple examples: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 12: Line 12:


You're totally right. It is plain wrong because it tries to use windowed reduction in APL like infix in J. An easy fix would be to combine <source lang=apl inline>(+⌿÷≢)</source> with concatenation <source lang=apl inline>,</source> by atop so that it looks like <source lang=apl inline>2((+⌿÷≢),)/3 4.5 7 21</source> (or <source lang=apl inline>2(+⌿÷≢)⍤,/3 4.5 7 21</source> in Dyalog 18.0); a general solution (allowing window size higher than 2) would be to extract windows and apply average on each of them <source lang=apl inline>(+⌿÷≢)¨ 2,/3 4.5 7 21</source>. I doubt if it's worth keeping either way in this context. --[[User:Bubbler|Bubbler]] ([[User talk:Bubbler|talk]]) 14:07, 27 June 2020 (UTC)
You're totally right. It is plain wrong because it tries to use windowed reduction in APL like infix in J. An easy fix would be to combine <source lang=apl inline>(+⌿÷≢)</source> with concatenation <source lang=apl inline>,</source> by atop so that it looks like <source lang=apl inline>2((+⌿÷≢),)/3 4.5 7 21</source> (or <source lang=apl inline>2(+⌿÷≢)⍤,/3 4.5 7 21</source> in Dyalog 18.0); a general solution (allowing window size higher than 2) would be to extract windows and apply average on each of them <source lang=apl inline>(+⌿÷≢)¨ 2,/3 4.5 7 21</source>. I doubt if it's worth keeping either way in this context. --[[User:Bubbler|Bubbler]] ([[User talk:Bubbler|talk]]) 14:07, 27 June 2020 (UTC)
:I've removed the moving average part [[User:Adám Brudzewsky|Adám Brudzewsky]] ([[User talk:Adám Brudzewsky|talk]]) 22:45, 27 June 2020 (UTC)

Navigation menu