Your example shows a one month interval from 8/31 to 9/30.
Are the time intervals always the same?
And how do you define a month? 30 days? the time from the end of month 1 to the end of month 2?
Relationships can be set up to match to different sets of records by Stock ID and time interval, then a summary field that computes the average and that is defined in your child table can be referenced from the context of your parent table in order to compute the arithmatic mean.
To compute a geometric mean can't be done with a summary field, nor a built in aggregate function. To get the geometric mean would require an expression such as:
Evaluate ( Substitute ( List ( ChildTable::Index ) ; ¶ ; " * " ) ) ^ ( 1/ Count ( ChildTable::Index ) )
PS: I looked up the info on this type of mean from Wikipedia.