I am not aware of a Geometric Mean function in JMP. One should be added, and I suggest that you add that to the JMP WishList. However, that does not mean that one can not do what you want. I came up with 2 different solutions. The first is just the raw coding of the Geometric Mean in JSL. In the attached data table, the column called GeoMean uses that formula. It uses your request, to calculate the geometric mean for the current row - 10 rows, through the current row.
If( Row() == 1,
Product = 1;
Range = 11;
);
If( Row() <= 11,
Product = Product * :height;
If( Row() == Range,
Returned = Product ^ (1 / Range),
Returned = .
);
,
Product = Product / :height[Row() - Range];
Product = Product * :height[Row()];
Returned = Product ^ (1 / Range);
);
Returned;
The second form, the column called Geomean from Dist Platform, extracts the Geometric Mean from the output of the Distribution Platform, run on a subset of the data, subsetting 11 rows at a time
If( Row() < 11,
returned = .,
theValues = :height[Index( Row(), Row() - 10 )];
_d = New Table( "sub", invisible, New Column( "height", values( theValues ) ) );
dis = _d << Distribution(
invisible,
Continuous Distribution(
Column( :height ),
Quantiles( 0 ),
Histogram( 0 ),
Vertical( 0 ),
Outlier Box Plot( 0 ),
Customize Summary Statistics(
Mean( 0 ),
Std Dev( 0 ),
Std Err Mean( 0 ),
Upper Mean Confidence Interval( 0 ),
Lower Mean Confidence Interval( 0 ),
N( 0 ),
Geometric Mean( 1 )
)
)
);
Returned = (Report( dis )[Number Col Box( 1 )] << get)[1];
Close( _d, nosave );
);
Returned;
The first formula should be the fastest, since it does not calculate the Geomean from scratch for each row.
Jim