[R] The Birnbaum-Saunders Distribution simmulation Problem

Muhammad Kashif mkashif at uaf.edu.pk
Tue Dec 29 10:32:05 CET 2015


Dear i optimized the gama and beta value using simmulation. if i run this code it generate very small value of beta. Could any one help me in this regard. i use gbs package to generate data.


gama=1.0
beta=1.3
n=25
iterCount=1000
for(i in 1:iterCount){
  x<-rgbs(n,gama,beta)
  P<-function(theta,x){
    n<-length(x)
    gama<-theta[1]
    beta<-theta[2]
    -n*log(5.013)+ n*(theta[1])^-2-n*log(theta[1])-n/2*log(theta[2])+ sum(log(theta[2]+x)-0.5/theta[1]^2*(x/theta[2]+theta[2]/x))}}
  P.out<-optim(theta<-c(gama,beta),ll.wd,x=x,method = "Nelder-Mead",hessian=FALSE)
  gamhat<-P.out$par[1]
  betahat<-P.out$par[2]


	[[alternative HTML version deleted]]



More information about the R-help mailing list