Description Usage Arguments Details Value Note Author(s) References See Also Examples

Written in C++, this function should always run faster than `cov`

for numeric vectors. For integer vectors, `cov_i`

should run even
faster.

1 | ```
cov_n(x, y)
``` |

`x` |
Numeric vector. |

`y` |
Numeric vector. |

NA

Numeric value.

NA

Dane R. Van Domelen

Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.

NA

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
# In general, cov_n is much faster than cov
x <- rnorm(1000)
y <- rnorm(1000)
all.equal(cov(x, y), cov_n(x, y))
microbenchmark(cov(x, y),
cov_n(x, y),
times = 100)
# For integer vectors, cov_i should be even faster.
x <- rpois(1000, lambda = 5)
y <- rpois(1000, lambda = 5)
all.equal(cov(x, y), cov_i(x, y))
microbenchmark(cov(x, y),
cov_n(x, y),
cov_i(x, y),
times = 100)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.