functionlogit1DQuadratic

Mapping a continuous input to a binary output through a quadratic logistic relation

Extends from Modelica.Icons.Function (Icon for functions).

Information

This function generates a random binary variable with the input of a continuous variable x from a quadratic logistic relation.

The probability of being 1 is calculated from the input x from a quadratic logistic relation with four predefined parameters A, B, C and D. Then a random generator generates the output, which should be a binary variable.

Inputs

TypeNameDefaultDescription
RealxContinous variable
RealA1.0Parameter defining the quadratic logistic relation
RealB1.0Parameter defining the quadratic logistic relation
RealC1.0Parameter defining the quadratic logistic relation
RealD1.0Parameter defining the quadratic logistic relation
Integer[Modelica.Math.Random.Generators.Xorshift1024star.nState]stateInState of the random number generator

Outputs

TypeNameDefaultDescription
BooleanyBinary variable
Integer[Modelica.Math.Random.Generators.Xorshift1024star.nState]stateOutNew state of the random number generator

Revisions

  • December 6, 2024, by Michael Wetter:
    Refactored implementation of random number calculations, transfering the local state of the random number generator from one call to the next.
    This is for #4069.
  • July 20, 2018, by Zhe Wang:
    First implementation.