Hi,
I have three functions (K2, K3, K3),
I would like to plot fp function of p (proportion) for K2 in the same drawing for K3 and K4, however, I have a problem in fp, I don't know where's the problem.
K2 <- function(s) {(15/8)*(1-s^2)^2}
K3 <- function(s) {(35/16)*(1-s^2)^3}
K4 <- function(s) {(315/128)*(1-s^2)^4}
fp <- function(p){
(integrate(function(s){s^(-(1/p)+1)}*(K2)^2, 0, 1))$v-(p/(2*p-1))
}
p=seq(0.1, 0.99, by=0.01)
plot(p,fp,type="l",col="blue", ylim=c(-0.5,0.5), ylab="", lwd = 1)
}
Thank you advance.