Displaying 2 results from an estimated 2 matches for "llgm".
Did you mean:
llgc
2008 May 21
2
Converting Data Types
...prints:
V1 V2 V3 V4 V5 V6
1 103.9 88.5 242.9 206.6 175.7 164.4
How can I convert the object "samples" such that it prints:
[1] 103.9 88.5 242.9 206.6 175.7 164.4
The reason I ask this because I can't use the former
"samples" object with this function:
llgm <- dgamma(samples, scale=1, shape=2, log = TRUE)
which gives this error:
e 1374Error in dgamma(x, shape, scale, log) :
Non-numeric argument to mathematical function
Regards,
Edward
2008 May 21
1
Log likelihood of Gamma distributions
Dear all,
How can I compute the log likelihood of a gamma
distributions of a vector.
I tried the following. But it doesn't seem to work:
samples<-c(6.1, 2.2, 14.9, 9.9, 24.6, 13.2)
llgm <- dgamma(samples, scale=1, shape=2, log = TRUE)
It gives
[1] -4.291711 -1.411543 -12.198639 -7.607465 -21.397254 -10.619783
I expect it only returns "one" value instead of vector.
What's wrong with my command above?
- Edward