blockGeometricMean

(Weighted) geometric mean

Extends from Interfaces.PartialConverters.MISO (Converter with multiple inputs and a single output).

Information

This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.

The scalar output y is obtained as the geometric mean of the components of the input vector u. Optionally weights can be given, either as constants (weights) or as variable inputs (u_weights).

y = (sum_i x_i^w_i)^(1/sum_i w_i)

Notes


  • If useWeights = false then all weights are assumed to be one.

  • If any of the components of u is less than or equal to zero, the output y will be zero.

  • Negative weights will be set to zero.

See also

geometricMean, ArithmeticMean

Parameters

TypeNameDefaultDescription
Realweightsones(nin)Weights to be used for inputs
Structural Parameters
Integernin (from MISO)2Number of input signals
BooleanuseWeightsfalse= true, if the output is to be a weighted geometric mean
BooleanhasConstantWeightstrue= true, if the weights are constant

Connectors

TypeNameDefaultDescription
Connectors.RealMultiInput[nin]u (from MISO)Input
Interfaces.Connectors.RealMultiInput[nin]u_weightsInput of weights

Components

TypeNameDefaultDescription
RealOutputy (from SO)