data.table::setDTthreads(2) #only needed for CRAN checks
theta_init <- c(1, 1, 3, 3, .2) #initial guess
data(caers)
proc <- processRaw(caers)
squashed <- squashData(proc, bin_size = 300, keep_pts = 10)
squashed <- squashData(squashed, count = 2, bin_size = 13, keep_pts = 10)
negLLsquash(theta = theta_init, ni = squashed$N, ei = squashed$E,
wi = squashed$weight)
#For hyperparameter estimation...
stats::nlminb(start = theta_init, objective = negLLsquash, ni = squashed$N,
ei = squashed$E, wi = squashed$weight)
Run the code above in your browser using DataLab