def train_val_test_split(time_series, train_start_timestamp, train_end_timestamp, val_end_timestamp):
  """
  Splits a given time series in training data, validation data and test data.

  Args:
    time_series (pandas.core.series.Series): input time series.
    train_start_timestamp (string): initial timestamp of training data
    train_end_timestamp (string): final timestamp of training data
    val_end_timestamp (string): final timestamp of validation data
  Returns:
    numpy.ndarray: training time series
    numpy.ndarray: validation time series
    numpy.ndarray: test time series
  """
  train = time_series[train_start_timestamp:train_end_timestamp].values
  val = time_series[train_end_timestamp:val_end_timestamp].values
  test = time_series[val_end_timestamp:].values

  return train, val, test