0

In the following program I can't find the right way to get the answer. I mean, can't find the right parameter value:

f.sigma <- function(sigma, x)
{
 n <- length(x)
 sum1 <- sum(x^2)
 sum2 <- sum(log(1-exp(-1*(x/sigma)^2)))
 sum3 <- sum(x^2/(exp((x/sigma)^2)-1))

 ans <- -1*n + sum1/sigma^2 + (n/sum2+1)/sigma^2*sum3
 return(ans)
}

burrx.mle1 <- function(x, lower, upper)
{
 n <- length(x)
sigma.root <- uniroot(f.sigma, interval=c(lower,upper), x=x)
sigmahat <- **sigma.root$root**
thetahat <- -1*n/sum(log(1-exp(-1*(x/sigmahat)^2)))
ans <- list(theta.hat=thetahat, sigma.hat=sigmahat)
 return(ans)
}
burrx.mle1(c(4,1,5),1,5)

another thing what does it mean my sigma.root$root? basically what is the use of $root? here in burrx.mle1(c(4,1,5),1,5) what does it mean my c(4,1,5)?

anova
  • 125
  • 1
  • 12

0 Answers0