[R] Plot cumulative probability of beta-prime distribution
aledanda
danda.galli at gmail.com
Wed Jul 1 09:19:59 CEST 2009
Hallo,
I need your help.
I fitted my distribution of data with beta-prime, I need now to plot the
Cumulative distribution. For other distribution like Gamma is easy:
x <- seq (0, 100, 0.5)
plot(x,pgamma(x, shape, scale), type= "l", col="red")
but what about beta-prime? In R it exists only pbeta which is intended only
for the beta distribution (not beta-prime)
This is what I used for the estimation of the parameters:
mleBetaprime <- function(x,start=c(1,1)) {
mle.Estim <- function(par) {
shape1 <- par[1]
shape2 <- par[2]
BetaprimeDensity <- NULL
for(i in 1:length(posT))
BetaprimeDensity[i] <- posT[i]^(shape1-1) *
(1+posT[i])^(-shape1-shape2) / beta(shape1,shape2)
return(-sum(log(BetaprimeDensity)))
}
est <- optim(fn=mle.Estim,par=start,method="Nelder-Mead")
return(list(shape1=est$par[1],shape2=est$par[2]))
}
posbeta1par <- fdp(posT, family= "beta1")
Hope you can help me.
Thanks a lot!!!
Ale
--
View this message in context: http://www.nabble.com/Plot-cumulative-probability-of-beta-prime-distribution-tp24285301p24285301.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list