tau effect

Effect on the distribution of event duration

Code
using DrWatson
@quickactivate
include(srcdir("main.jl"))
easy_save (generic function with 2 methods)
Code
df = reduce(vcat, [
    load(tau = 20),    
    load(tau = 60),
    load(tau = 180),
])

df.tau = CategoricalArray(df.tau);
Code
# datalimits_f = x -> (0, 100)
datalimits_f = x -> quantile(x, [0.03, 0.97])

plt = data(df) * mapping(:duration, color=:tau, layout=:r) * (visual(Lines) + visual(Scatter))
specs = plt * histogram(; datalimits=datalimits_f, normalization=:density) 
axis = (; yscale=log10)
facet = (; linkxaxes=:none, linkyaxes=:none)
draw(specs, axis=axis, facet=facet)
easy_save("tau_effect"; dir="../figures/method")
┌ Info: Saved /Users/zijin/projects/ids_spatial_evolution_juno/figures/method/tau_effect.png
└ @ beforerr /Users/zijin/.julia/dev/beforerr.jl/src/utils/makie.jl:34
Code
specs = plt * histogram(; datalimits=datalimits_f)
draw(specs, axis=axis, facet=facet)

And large duration probabilities remain the same from 1-5au This is sufficient to justify using one tau in different radial distances

Code
datalimits_f = x -> quantile(x, [0.05, 0.95])
specs = data(df) * mapping(:duration, color=:r, layout=:tau) * density(;datalimits = datalimits_f)
draw(specs, facet = (; linkxaxes = :none, linkyaxes = :none))

Effect on the number of observations

Code
# plot the number of events with respect to tau in different radial distances
j_events_taus = 60:-10:20 .|> load_tau |> x -> reduce(vcat, x);
specs = data(j_events_taus) * mapping(:tau, row=:r) * histogram()
draw(specs, facet=(; linkyaxes=:none))
Code
# get unique events defined by the starting time and ending time
cols = [:"t.d_start", :"t.d_end"]

println("Number of events: ", size(j_events_taus, 1))
j_events_taus_u = unique(j_events_taus, cols)
println("Number of unique events: ", size(j_events_taus_u, 1))
Number of events: 129460
Number of unique events: 88679