Frequency Increment Test

## Usage

```
fit(object, dates, ...)
# S4 method for data.frame,numeric
fit(object, dates)
# S4 method for matrix,numeric
fit(object, dates)
```

## Arguments

- object
An \(m \times p\)

`numeric`

`matrix`

or a`data.frame`

of count data (absolute frequencies).- dates
A

`numeric`

vector of dates expressed in CE years (BCE years must be given as negative numbers).- ...
Currently not used.

## Value

An IncrementTest object.

## Details

The Frequency Increment Test (FIT) rejects neutrality if the distribution of normalized variant frequency increments exhibits a mean that deviates significantly from zero.

## References

Feder, A. F., Kryazhimskiy, S. & Plotkin, J. B. (2014). Identifying
Signatures of Selection in Genetic Time Series. *Genetics*, 196(2):
509-522. doi:10.1534/genetics.113.158220
.

## Examples

```
## Data from Crema et al. 2016
data("merzbach", package = "folio")
## Keep only decoration types that have a maximum frequency of at least 50
keep <- apply(X = merzbach, MARGIN = 2, FUN = function(x) max(x) >= 50)
counts <- merzbach[, keep]
## Group by phase
## We use the row names as time coordinates (roman numerals)
dates <- as.numeric(utils::as.roman(rownames(counts)))
## Frequency Increment Test
freq <- fit(counts, dates)
## Plot time vs abundance and highlight selection
plot(freq)
plot(freq, roll = TRUE, window = 5)
```