HomeTechniques and Tips@RISK DistributionsStatistics for Just Part of a Distribution

# 3.10. Statistics for Just Part of a Distribution

Applies to: @RISK 5.x–7.x

I want to get the mean and standard deviation for just part of my input distribution. If I enter truncation limits in the Define Distribution window or include RiskTruncate( ) in the distribution formula, then the mean and standard deviation of my distribution change and that is not what I want. I want the regular distribution to be simulated, but then after simulation I want to consider only part of it when computing the statistics.
OR,
I have applied a filter, but the statistics functions are still computed on the whole of the output distribution. Is there a way to get the mean of the filtered data set using RiskMean?

To use the whole distribution in simulation but then get the statistics of just a portion of it, put a RiskTruncate( ) or RiskTruncateP( ) function inside the RiskMean( ).  A very minimal example is attached.

• A1 contains: =RiskNormal(100,10).

• A2 contains: =RiskMean(A1, RiskTruncate(95)), which computes the mean of the part of the distribution from 95 to infinity.  This is equivalent to =RiskMean(A1, RiskTruncate(95, 1E+99)). RiskTruncate( ) specifies truncation limits by values.

• A3 contains: =RiskMean(A1, RiskTruncateP(0.8,1)), which computes the mean of the part of the distribution from the 80th to the 100th percentile, the top 20% of the distribution. RiskTruncateP( ) specifies truncation limits by percentiles.

The other statistics functions can have RiskTruncate( ) or RiskTruncateP( ) applied in the same way. This you can get the mean of part of a distribution, percentiles of part of a distribution, standard deviation of part of a distribution, and so on.

About accuracy of theoretical statistics: Most distributions have no closed form for the mean of a truncated distribution. Therefore, if you're using a statistic function such as RiskTheoMean( ) with RiskTruncate( ) or RiskTruncateP( ), @RISK has to do a little mini-simulation to approximate the theoretical mean of the truncated distribution. This may differ from the actual theoretical mean by a small amount, usually not more than a percent or two. With a truncated simulated distribution, using a statistic function such as RiskMean( ) with RiskTruncate( ) or RiskTruncateP( ), @RISK uses actual simulation data. Thus results are accurate with respect to that simulation, but another simulation with a different random number seed would of course give slightly different results.

See also: Cutting Off a Distribution at Left or Right for truncating an input distribution and using only the truncated distribution in simulation.

Last edited: 2018-05-09