ISmNormalDistribution.Mean

Syntax

Mean: Double;

Description

The Mean property determines expected value.

Example

To execute the example, the form must have the ChartBox component and the UiChart component which serves as the source for ChartBox.

Class OBJ18688Form: Form
    ChartBox1: ChartBox;
    UiChart1: UiChart;
    Norm: SmNormalDistribution;
    Values: Array Of Double;
    Const Cnt = 10;

    Sub OBJ18688FormOnCreate(Sender: Object; Args: IEventArgs);
    Begin
        Norm := New SmNormalDistribution.Create;
        Text := Norm.DisplayName;
        Norm.Mean := 43;
        Norm.Variance := 0.5;
        Values := Norm.RandomVector(Cnt);
        UiChart1.PointCount := cnt;
    End Sub OBJ18688FormOnCreate;
    
    Sub UiChart1OnGetDataValue(Sender: Object; Args: IUiChartGetDataValueEventArgs);
    Begin
        If Args.PointIndex < Cnt Then
        Args.Value := Values[Args.PointIndex];
        Args.Result := True;
        End If;
    End Sub UiChart1OnGetDataValue;
End Class OBJ18688Form;

Executing this example makes a chart for normal value distribution:

See also:

ISmNormalDistribution