hi,
I wrote a set of R functions for estimating what is the probability
function that best fits a set of data. I wrote them based in this response:
/http://tolstoy.newcastle.edu.au/R/help/03b/1714.html/
I extracted the relevant segment of the link above:
//> PPCC <- function(shape, scale, x) { # only for weibull /
+ x <- sort(x)
+ pp <- ppoints(x)
+ cor( qweibull(pp, shape=shape, scale=scale), x)} /
I clearly read, "/only for weibull"/ however I wrote similar functions
for /normal, exponential, poisson, and lognormal. /
Could someone says me if these functions are correct? Are there other
ways to estimate the correlation coefficient?
/PPCCNORM <- function(x,mean,sd) {
x <- sort(x)
pp <- ppoints(x)
cor(qnorm(pp,mean=mean,sd=sd),x)
}
PPCCLOG <- function(x,mean,sd) {
x <- sort(x)
pp <- ppoints(x)
cor(qlnorm(pp,meanlog=mean,sdlog=sd),x)
}
PPCCPOIS <- function(x,lambda) {
x <- sort(x)
pp <- ppoints(x)
cor(qpois(pp,lambda=lambda),x)
}
PPCCEXP <- function(x,rate) {
x <- sort(x)
pp <- ppoints(x)
cor(qexp(pp,rate=rate),x)
}/
Thanks in advanced,
[[alternative HTML version deleted]]