Skip to main content
Question

How to calculate truncated mean?


Hello everyone,

 

I have a workspace that takes 2 point feature classes from a geodatabase and calculates the Root Mean Square Error (RMSE) of the x and y coordinates (i.e. sqrt( x(observed) - x(predicted))**2/n)). As part of this calculation I would have to do a truncated mean calculation where I would drop the top and bottom 10 % of records of residual X,Y values and then calculate the RMSE on the remaining 80% of the records. I understand the statistics calculation for truncated mean but I am not sure how to do this in FME workspace.

 

Any help/suggestion is greatly appreciated.

 

Thank you! 

6 replies

takashi
Influencer
  • June 27, 2015
Hi,

 

 

How about this procedure? Assuming that you have created features which contain "x(observed)" and "x(predicted)" as attributes.

 

(1) For each feature, calculate "(x(observed) - x(predicted))**2" and assign the result value to a new attribute. e.g. "value"

 

(2) Use a StatisticsCalculator to count the number of features, and set it to every feature. e.g. "num"

 

(3) Add the lower and upper thresholds of the "num" to the features coming from the Complete port of the StatisticsCalculator.

 

lower = num * 0.1

 

upper = num * 0.9

 

(4) Sort the features by the "value".

 

(5) Add 0-based sequential number to the features with a Counter. e.g. "count".

 

(6) Filter out  the features whose "count" is less than "lower" or greater than "upper".

 

(7) Calculate the RMSE using the remained features.

 

 

Takashi

  • Author
  • June 29, 2015
Thanks a lot Takashi! The process works!!!

bhanu_v
Forum|alt.badge.img
  • September 20, 2019

Hello @proxima ,@takashi

I'm trying to accomplish the exact same thing , Im not calculating RMS.

On step2,you talk about setting it to every feature."e.g num"

(the _count attribute has a count i.e total number of records in the excel)

I have excel file of count ,position and torque of a valve . I want to calculate truncated mean

I'm looking for direction on how you have accomplished this.

Thanks in advance

 


bhanu_v
Forum|alt.badge.img
  • September 20, 2019
takashi wrote:
Hi,

 

 

How about this procedure? Assuming that you have created features which contain "x(observed)" and "x(predicted)" as attributes.

 

(1) For each feature, calculate "(x(observed) - x(predicted))**2" and assign the result value to a new attribute. e.g. "value"

 

(2) Use a StatisticsCalculator to count the number of features, and set it to every feature. e.g. "num"

 

(3) Add the lower and upper thresholds of the "num" to the features coming from the Complete port of the StatisticsCalculator.

 

lower = num * 0.1

 

upper = num * 0.9

 

(4) Sort the features by the "value".

 

(5) Add 0-based sequential number to the features with a Counter. e.g. "count".

 

(6) Filter out  the features whose "count" is less than "lower" or greater than "upper".

 

(7) Calculate the RMSE using the remained features.

 

 

Takashi

Hello @proxima ,@takashi

I'm trying to accomplish the exact same thing , Im not calculating RMS.

On step2,you talk about setting it to every feature."e.g num"

(the _count attribute has a count i.e total number of records in the excel)

I have excel file of count ,position and torque of a valve . I want to calculate truncated mean

I'm looking for direction on how you have accomplished this.

Thanks in advance

 


takashi
Influencer
  • September 22, 2019
bhanu_v wrote:

Hello @proxima ,@takashi

I'm trying to accomplish the exact same thing , Im not calculating RMS.

On step2,you talk about setting it to every feature."e.g num"

(the _count attribute has a count i.e total number of records in the excel)

I have excel file of count ,position and torque of a valve . I want to calculate truncated mean

I'm looking for direction on how you have accomplished this.

Thanks in advance

 

Hi @adi, check out the features output from the Complete port. All the input features will be output via this port and they have every computed statistics value - "num" in this case.


bhanu_v
Forum|alt.badge.img
  • September 24, 2019

Thank you @takashi, I appreciate your response,I was able to figure it out and calculate truncated mean

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings