On 30-11-2012, at 23:55, Mac Gaulin wrote:
> Hello,
>
> I am trying to understand a small quirk I came across in R. The
> following code results in an error:
>
> k <- c(2, 1, 1, 5, 5)
> f <- c(1, 1, 1, 3, 2)
> loglikelihood <- function(theta,k,f){
>if( theta<1 && theta>0 )
>return(-
On 30.11.2012 23:55, Mac Gaulin wrote:
Hello,
I am trying to understand a small quirk I came across in R. The
following code results in an error:
k <- c(2, 1, 1, 5, 5)
f <- c(1, 1, 1, 3, 2)
loglikelihood <- function(theta,k,f){
if( theta<1 && theta>0 )
return(-1*sum(log(choose(k
Hello,
I am trying to understand a small quirk I came across in R. The
following code results in an error:
k <- c(2, 1, 1, 5, 5)
f <- c(1, 1, 1, 3, 2)
loglikelihood <- function(theta,k,f){
if( theta<1 && theta>0 )
return(-1*sum(log(choose(k,f))+f*log(theta)+(k-f)*log(1-theta)))
re
3 matches
Mail list logo