nearest.point: Identify nearest point in time to a given estimate value

Description Usage Arguments Value

View source: R/1d.smooths.r

Description

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.

Usage

1
nearest.point(kernel.smooths, density, variant, n = 1, timerange)

Arguments

kernel.smooths

A list output by kernel.smooth.in.time().

density

The value of the dependent variable for which a time is to be identified.

variant

If the dependent variable was a factor, which level is being examined (do not give a value if dependent variable was numeric).

n

The number of nearest points to be returned (useful if the estimates cross the relevant threshold multiple times, defauls to 1).

timerange

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).

Value

One or more numeric values.


kernelPhil documentation built on Feb. 25, 2021, 5:08 p.m.