你好
给定一列带有数值的列,我想以这种方式计算MA:
MAi = 1 / N * SUM(j = i-1至j = iw)Xj
其中w是窗口宽度,i-1是起始元素,iw是最后一个元素。 不用w = 2做例子
x
-------------
1 x1
2 x2
3 x3…..
4 x4 MA =(X3 + X2)/ 2
5 x5 MA =(X4 + X3)/ 2
6 x6…..
7 x7
通过使用“新建公式”列->“行”功能
我将权重设置为“相等”。 要获得我之前报告的内容,之前的项目和之后的项目如何?
如果我要使用指数权重,也会出现同样的问题。

谢谢菲利斯
你好,
如果它是一个简单的移动平均值,则可以使用“公式编辑器”中的Lag()函数轻松地对其进行计算。
下面是一个有关如何计算Tablet Production示例数据表中的Dissolution列的前3行移动平均值的示例:
// Open Data Table: Tablet Production.jmp
// → Data Table( "Tablet Production" )
Open( "$SAMPLE_DATA/Tablet Production.jmp" );
// New column: Dissolution_MA3
Data Table( "Tablet Production" ) << New Column( "Dissolution_MA3",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
(Lag( :Dissolution, 1 ) + Lag( :Dissolution, 2 ) + Lag( :Dissolution, 3 ))
/ 3
)
);
// Report snapshot: Tablet Production - Graph Builder
Data Table( "Tablet Production" ) << Graph Builder(
Size( 799, 452 ),
Show Control Panel( 0 ),
Variables( Y( :Dissolution ), Y( :Dissolution_MA3, Position( 1 ) ) ),
Elements( Line( Y( 1 ), Y( 2 ), Legend( 6 ), Row order( 1 ) ) )
);
马西莫干杯