[R] a problem about GPD distribution fit

2009-11-14 Thread fuzuo xie
If i want to fit my data using gpd(data) in a extreme theory packages , how can i fit the lower tail of my data ?? the gpd function seems just has upper threshold , so ,if i want to fit the lower tail of my data , i have to use gpd(-data) . can i fit the lower tail just use gpd(data)

[R] a problem about integrate function in R .thank you .

2009-10-22 Thread fuzuo xie
e2 <- function(x) { out <- 0*x for(i in 1:length(x)) out[i] <-integrate(function(y) qnorm(y),lower=0,upper=x[i])$value out } integrate(e2,lower=0, upper=a)$value above is my code , when a is small , say a<0.45 the result is right . however , when a>0.5 the result is incorrect .

[R] integrate() function error

2009-10-22 Thread fuzuo xie
This is my code , when i run it ,error happed . can you tell me what's the reason and modify it ?thank you very much !! the error is "evaluation of function gave a result of wrong length" e2<-function(a) integrate(function(x) x,lower=0,upper=a)$value integrate(e2,lower=0, upper=0.5)$value