[R] ECDF, distribution of Pareto, distribution of Normal
livia
yn19832 at msn.com
Wed Jul 11 10:32:28 CEST 2007
Thank you very much for your reply. I am afraid I have no idea what is wrong
with the pgpg function. The parameters are generated from pre-fitted GPD
distribution. 1.544 is the location parameter, 0.4373 is the scale parameter
and -0.2398 is the shape parameter.
Cound you please give me some hint?
Stefan Grosse-2 wrote:
>
>
>
> -------- Original Message --------
> Subject: [R] ECDF, distribution of Pareto, distribution of Normal
> From: livia <yn19832 at msn.com>
> To: r-help at stat.math.ethz.ch
> Date: Tue Jul 10 2007 18:35:04 GMT+0200
>> Hello all,
>>
>> I would like to plot the emperical CDF, normal CDF and pareto CDF in the
>> same graph and I amusing the following codes. "z" is a vector and I just
>> need the part when z between 1.6 and 3.
>>
>> plot(ecdf(z), do.points=FALSE, verticals=TRUE,
>> xlim=c(1.6,3),ylim=c(1-sum(z>1.6)/length(z), 1))
>>
>> x <- seq(1.6, 3, 0.1)
>> lines(x,pgpd(x, 1.544,0.4373,-0.2398), col="red")
>>
>
> There is something wrong with your pgpd function, see ?pgpd for help and
> parameters... (I wonder how you got something plotted here...)
>
>
>> y <- seq(1.6, 3, 0.1)
>> lines(y,pnorm(y, mean(z),sqrt(var(z))), col="blue")
>>
>> The emperical CDF and normal CDF look rather resonable, but the pareto
>> CDF
>> looks quite odd. I am not sure whether I plot the pareto CDF correctly
>> e.g.
>> in the right yaxs or any other mistake?
>>
>> At the same time, let "t" represents the vector whose values are larger
>> than
>> 1.6(the part we want). If I implement the following codes and plot the
>> emperical CDF and pareto CDF, the pareto CDF seems fit.
>>
>> plot(ecdf(t), do.points=FALSE, verticals=TRUE)
>> x <- seq(1.6, 3, 0.1)
>> lines(x,pgpd(x, 1.544,0.4373,-0.2398), col="red")
>>
>> Could anyone give me some advice on this? Many thanks.
>>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
--
View this message in context: http://www.nabble.com/ECDF%2C-distribution-of-Pareto%2C-distribution-of-Normal-tf4056943.html#a11536305
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list