[R] (no subject)

Muhammad Kashif mkashif at uaf.edu.pk
Sun Jan 3 01:02:33 CET 2016


Dear i optimized the gama and beta value using MLE via simmulation of birnbaum saunders distribution. 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