search for: dnewdis

Displaying 1 result from an estimated 1 matches for "dnewdis".

Did you mean: dlewis
2012 Jul 07
4
Declaring a density function with for loop
...://r.789695.n4.nabble.com/file/n4635699/kb.png Here alpha and beta are two parameters and x=0,1,2,3,...n (alike the binomial distribution) I am writing a function to find out the densities (probabilities) of this distribution for given values of alpha and beta. The below is the my function... *dnewdis<-function(x,a,b,n) { term<-0 for (j in 0:exp(10)) { term=term+(((-1)**i)*(choose(b-1,i))*(beta(x+a+a*i,n-x+1))) } s=a*b*choose(n,x)*term return(s) }* Since the sum inside the pdf runs from 0 to infinity, i restrict it to exp(10)[a la...