You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, for generating the input, an external resource is downloaded and parsed by a xpath handler.
At the end of this pre-process, it generates a list which represents a time series.
But I found that the resulting list just contains one element.
This example seems broken to me since the Hawkes Process isn't designed to model this kind of time series and the time series is totally different from the figure in the next section.
code:
import requests
from lxml import html
from datetime import datetime as dt
import numpy as np
res = requests.get("http://www.koeri.boun.edu.tr/scripts/lst9.asp")
tx = html.fromstring(res.content).xpath("//pre/text()")[0]
lines = tx.splitlines()[7:] # get rid of the headers
# take out timestamps and convert them to "hours since first event"
timestamps = [dt.strptime(l[:19], "%Y.%m.%d %H:%M:%S") for l in lines if "ISTANBUL" in l]
print(timestamps)
print(timestamps[-1])
t = np.array([(x - timestamps[-1]).total_seconds() / 3600 for x in timestamps])[::-1]
print(t)
(In this code the original ts[-1] is replaced with timestamps[-1] since I couldn't find ts)
Hi. I see you've done a lot of research on timing. As a beginner, I would like to ask you for a simple Hawkes process data and code package, do you have it? Thank you very much.
Hi,
See: https://hawkeslib.readthedocs.io/en/latest/example.html#example-modeling-seismic-activity
In this example, for generating the input, an external resource is downloaded and parsed by a xpath handler.
At the end of this pre-process, it generates a list which represents a time series.
But I found that the resulting list just contains one element.
This example seems broken to me since the Hawkes Process isn't designed to model this kind of time series and the time series is totally different from the figure in the next section.
code:
(In this code the original
ts[-1]
is replaced withtimestamps[-1]
since I couldn't findts
)output:
The text was updated successfully, but these errors were encountered: