fit_t_dist_fixed_mu | R Documentation |
use optim() to fit a t-distribution with fixed mu=0
fit_t_dist_fixed_mu(x)
x |
numeric vector of at least 10 finite values |
## Not run:
# fit normal
x = rnorm(1000, sd = 2)
fit = suppressWarnings(fit_t_dist_fixed_mu(x))
h = hist(x, breaks = 25, freq = F)
curve(dt(x / fit[1], df=fit[2]) / fit[1], col = 2, add = T)
## End(Not run)
## Not run:
# fit t-distribution
x = rt(1000, df = 3)
fit = suppressWarnings(fit_t_dist_fixed_mu(x))
h = hist(x, breaks = 25, freq = F)
curve(dt(x / fit[1], df=fit[2]) / fit[1], col = 2, add = T)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.