[R] generalized pareto and histogram

From: Assieh Rashidi <assiehrashidi_at_yahoo.com>
Date: Sun, 20 Jun 2010 10:45:19 -0700 (PDT)


Hello everybody
I have some questions:
1)      For generating data from Generalized pareto distribution, I used POT package and I have example that used shape=2, but it can’t be appropriate. 2)      Exact density of histogram of theta in this program doesn’t display. i<-1
X<-rep(0, times=500)
theta<-rep(0, times=500)
X[i]<-20
theta[i]<-10
alpha<-5
k<-2
lambda<-1000
for (i in 1:500){
X[i+1]<-rgamma(1,k,theta[i])
theta[i+1]<-rgamma(1,alpha+k, lambda+X[i+1]) cat("X[i+1]" , X[i+1], "\n")
cat("theta[i+1]" , theta[i+1], "\n")
}
########Histogram of theta############
brk<-seq(0,10, by=0.0005)
hist(theta, breaks=brk,freq=FALSE,xlim=c(0,0.02),  main = paste(""),xlab="Histogram of samples values of theta") lines(density(theta), col="red")
legend(x=0.010, y=150,"Exact Density",col="red",lty=c(1,3))  
A.Rashidi

      
	[[alternative HTML version deleted]]


______________________________________________

R-help_at_r-project.org 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. Received on Sun 20 Jun 2010 - 17:48:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 20 Jun 2010 - 18:20:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive