Calculate the likelihood cross validation score for several bandwidths for the Temporal Kernel density

bw_cv_likelihood_calc_tkde(events, w, bws, kernel_name)

Arguments

events

A numeric vector representing the moments of occurrence of events

w

The weight of the events

bws

A numeric vector, the bandwidths to use

kernel_name

The name of the kernel to use

Value

A vector with the cross validation scores (the higher the better).

Examples

data(bike_accidents)
bike_accidents$Date <- as.POSIXct(bike_accidents$Date, format = "%Y/%m/%d")
start <- min(bike_accidents$Date)
diff <- as.integer(difftime(bike_accidents$Date , start, units = "days"))
w <- rep(1,length(diff))
scores <- bw_cv_likelihood_calc_tkde(diff, w, seq(10,60,10), "quartic")