Using only vanilla PostgreSQL, how do I predict a future number based on existing data?
Besides the point that there is literally a whole branch of mathematics which is only focusing on answering your question, which should give you a hint that there is no "silver bullte" easy formula to use in any case.

WARNING I only have a basic understanding of statistics but I know that you cannot use the mean as a reliable value to predict future values. In almost all, if not all, cases a prediction depends very much on the distribution type of your events. This mean value will only get you a rough estimate which might be better than selecting a random number.

Anyway here is my implementation of a mean timestamp between two events:

Create table eventsTable(
  id int,
  TS timestamp);

Insert into eventsTable VALUES (1, '2020-05-07 08:00');
Insert into eventsTable VALUES (1, '2020-05-07 08:05');
Insert into eventsTable VALUES (1, '2020-05-07 08:10');
Insert into eventsTable VALUES (1, '2020-05-07 08:15');
Insert into eventsTable VALUES (1, '2020-05-07 08:20');
Insert into eventsTable VALUES (1, '2020-05-07 08:25');


SELECT 
  EXTRACT(EPOCH FROM (Max(TS) - Min(TS))) / ( COUNT(*)  -1) as Mean_Number_Of_Seconds_Untill_Next_Event
FROM eventsTable
WHERE TS &gt; '2020-05-07 08:10'


Fiddle link

It just takes the maximum and minimum value and divides it by the number of new events in that time interval. Use the where clause to find a good time interval for performance and prediction correctness.