@classmethod
def estimateInitialPeltValue(cls, first_val, first_event_time_s,
    start_time_s, half_life_ms):
    """There will typically be a delay between the time when a task starts,
        and the first trace event that logs PELT signals for that task. During
        this time the signal will change from its initial value. This method
        takes the time at which a task starts running and the timestamp and
        value of the first PELT trace event related to that task. It returns an
        estimate for the value the PELT signal had the task started.

        Example:
        ::

            +---------------------+      Task is RUNNING
            |              E      |

          --+--------------+------+--------- Time --->
            ^              ^
          task_start     first PELT event logged for the task

        This method estimates the value of the PELT signal at task_start,
        assuming the task was running in the interval of time between
        task_start and the first PELT event logged of the task.

        :param first_val: value of the very first event realted to the
            task that shows PELT info
        :type first_val: int

        :param first_event_time_s: instant of time in seconds when the first
            PELT event related to the task was generated
        :type first_event_time_s: float

        :param start_time_s: instant of time in seconds when the task starts
            running for the first time
        :type start_time_s: float

        :param half_life_ms: the [ms] interval required by a signal to
                             increased/decreased by half of its range
        :type  half_life_ms: int

        :returns: int - Estimated value of PELT signal when the task starts
        """
    geom_y = pow(0.5, 1.0 / half_life_ms)
    geom_u = float(cls._signal_max) * (1.0 - geom_y)
    time_since_start = first_event_time_s - start_time_s
    if time_since_start < 0:
        raise ValueError(
            'First sched_load_avg_* event happens before the task starts')
    updates_since_start = int(time_since_start / (cls._sample_us / 1000000.0))
    pelt_val = first_val
    for i in range(updates_since_start):
        pelt_val = (pelt_val - geom_u) / geom_y
    return pelt_val
