Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fit_distr

Fit distribution to data


Description

Wrapper to fit a distribution to data. Currently implemented distributions are the exponential distribution (exp), the gamma distribution (gamma) and the von Mises distribution (vonmises).

Usage

fit_distr(x, dist_name, na.rm = TRUE)

Arguments

x

[numeric(>1)]
The observed data.

dist_name

[character(1)]{"exp", "gamma", "unif", "vonmises"}
The name of the distribution.

na.rm

[logical(1)=TRUE]
Indicating whether NA should be removed before fitting the distribution.

Value

An amt_distr object, which consists of a list with the name of the distribution and its parameters (saved in params).

Examples

set.seed(123)
dat <- rexp(1e3, 2)
fit_distr(dat, "exp")

amt

Animal Movement Tools

v0.1.4
GPL-3
Authors
Johannes Signer [aut, cre], Brian Smith [ctb], Bjoern Reineking [ctb], Ulrike Schlaegel [ctb], John Fieberg [ctb], Scott LaPoint [dtc]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.