This function takes the output of kernel.smooth.in.time and identifies the point in time when the smoothed estimate comes closest to some specific value. This is useful for tasks like identifying the likely midpoint of a change.
nearest.point(kernel.smooths, density, variant, n = 1, timerange)A list output by kernel.smooth.in.time().
The value of the dependent variable for which a time is to be identified.
If the dependent variable was a factor, which level is being examined (do not give a value if dependent variable was numeric).
The number of nearest points to be returned (useful if the estimates cross the relevant threshold multiple times, defauls to 1).
Numeric vector of length two - used to restrict search to a specific time range within the kernel.smooth.in.time(), in the form c(min,max).
One or more numeric values.