Displaying 1 result from an estimated 1 matches for "mixedgamma".
Did you mean:
pmixedgamma3
2012 Mar 15
2
Integrate inside function
Dear R users,
first I take this opportunity to greet all the R community for your
continuous efforts.
I wrote a function to calculate the pdf and cdf of a custom distribution
(mixed gamma model).
The function is the following:
pmixedgamma3 <- function(y, shape1, rate1, shape2, rate2, prev)
{
density.function<-function(x)
{
shape1=shape1
rate1=rate1
shape2=shape2
rate2=rate2
prev=prev
fun<-prev*((rate1^shape1)/gamma(shape1)*(x^(shape1-1))*exp(-rate1*x))
+ (1-prev)*((rate2^shape2)/gamma(shape2)*(x^(shape2-1))...