Trying to compute slopes in a moving window.
Y = MovAvg25
X = Counter
Objective is the computation of least square slopes for any row in the data for a moving (sliding) window size of 150 pts.
I believe function of Index(Row()-149, Row()+0) is correctly describing the moving window (this is before I realized that JMP13 has a moving window function built in, I can use that too) ....
Overall data contains 1800 pts. If I change the moving window size to coincide w/ 1800 (ie. Row()-1799 instead of Row()-149), then the formula computes overall single slope correctly. When using 150 pts, a wrong output gets calculated as a single identical slope for all pts (ie.scalar, hence I know something is wrong).
thanks in advance for any help ....
What I have
or in other form
If( :Counter >= 150,
Col Sum(
(:Counter
-Mean(
:Counter[
Index(
Row() - 149,
Row() + 0
)]
)) * (:MovAvg25
-Mean(
:MovAvg25[
Index(
Row() - 149,
Row() + 0
)]
))
) /
Col Sum(
(:Counter
-Mean(
:Counter[
Index(
Row() - 149,
Row() + 0
)]
)) ^ 2
),
.
)