Dear R users,

I have been trying to compute the following function and need it to work
with n=15000, but it would only compute for smaller ns, such as n=1000 and
not above. I was wondering if anyone would have a solution for this problem!
Thank you very much for your kind support!

Sincerely,

Nan

------

Wi <- function(n)    {
    fun <- function(w,i){
        w*(-log(w))*((w-w*log(w))^(i-1))*((1-w+w*log(w))^(n-i));
    }
    out <- as.double(n);

    for(i in 1:n){
        out[i] <- integrate(fun,lower=0,upper=1,i=i)$value;
        out[i] <- out[i]*n*choose(n-1,i-1);
    }
    out
}

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to