Description Usage Arguments Examples
This function calculates the log-likelihood at some parameter values given the random sample and distribution.
1 |
x |
numeric vector. |
dist |
density name for the distribution in the form |
param |
list with the parameter values at which can be calculated the log-likelihood. |
1 2 3 4 5 6 7 8 9 10 | # For Poisson distribution
x <- rpois(n=50, lambda=4.5)
loglik(x, dist='dpois', param=list(lambda=4))
loglik(x, dist='dpois', param=list(lamb=4.5))
loglik(x, dist='dpois', param=list(lambda=5))
# For normal distribution
y <- rnorm(n=100, mean=170, sd=10)
loglik(x=y, dist='dnorm', param=list(mean=170, sd=10)) # Evaluated at true theta
loglik(x=y, dist='dnorm', param=list(mean=150, sd=20)) # Evaluated at any theta
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.