Skip to main content
. 2024 Feb 26;6(1):114–128. doi: 10.3390/clockssleep6010009
Algorithm 1 Virtual individual generation. Takes as input posterior draws of α,β,σ0,σ1 in Equation (2)
  • 1:

    procedure VirtualIndividual(α,β,σ0,σ1)

  • 2:

        Sample a from a kernel density approximation of empirical distribution using inverse transform sampling

  • 3:

        Uniformly sample a set of random (α,β,σ0,σ1) values from posterior draw set

  • 4:

        Use Equation (2) to draw a value of logb (and hence b)

  • 5:

        Use ed(x)=10a(1+1/(1x))1/b to calculate ED25 (x=0.25) and ED75 (x=0.75) for that individual

  • 6:

        If ED25 is less than half the minimum ED25 in estimates from [22], reject (a,b) and call VirtualIndividual

  • 7:

        If ED75 is greater than 1.5 times the maximum ED75 in estimates from [22], reject (a,b) and call VirtualIndividual

  • 8:

        return (a,b) which characterise a dose-response curve

  • 9:

    end procedure