# How to use HawkesProcesses.jl to plot intensity for a given vector?

**URL:** <https://discourse.julialang.org/t/how-to-use-hawkesprocesses-jl-to-plot-intensity-for-a-given-vector/98073>\
**Category:** General Usage\
**Created:** [April 29, 2023, 2:23am UTC](https://discourse.julialang.org/t/how-to-use-hawkesprocesses-jl-to-plot-intensity-for-a-given-vector/98073 "2023-04-29T02:23:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bryaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bryaan/32/36858_2.png) [@bryaan](https://discourse.julialang.org/u/bryaan)\
**Post date:** [April 29, 2023, 2:23am UTC](https://discourse.julialang.org/t/how-to-use-hawkesprocesses-jl-to-plot-intensity-for-a-given-vector/98073/1 "2023-04-29T02:23:36Z")

</div>

I’m trying to figure out how to use HawkesProcesses.jl to get the intensity for a given input vector of event arrival data.

```julia

# Event arrival data vector
eventTimestamps = sort(rand(100)*100)

bg = 0.5
kappa = 0.5
kernel(x) = pdf.(Distributions.Exponential(1/0.5), x)

# This doesn't seem to generate an array of data that could be used.
testSamples = HawkesProcesses.fit(eventTimestamps, maxT, iterations)

# This doesn't look like it has a way of inputting the event data, unless it gets wrapped up in the kernel
simevents = HawkesProcesses.simulate(bg, kappa, kernel, maxT)

# This is my targeted intensity function i want to run
ts = collect(1:maxT)
intensity = HawkesProcesses.intensity(ts, testSamples, bg, kappa, kernel)

```

---

<div class="post-metadata">

**Author:** ![bryaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bryaan/32/36858_2.png) [@bryaan](https://discourse.julialang.org/u/bryaan)\
**Post date:** [April 29, 2023, 3:50am UTC](https://discourse.julialang.org/t/how-to-use-hawkesprocesses-jl-to-plot-intensity-for-a-given-vector/98073/2 "2023-04-29T03:50:17Z")

</div>

> [@bryaan](#):
>
> `intensity = HawkesProcesses.intensity(ts, testSamples, bg, kappa, kernel)`

Actually looks like it’s pretty simple: Just had to pass the events data to the intensity function, no need to simulate for event data. Was misunderstanding that concept.
