Professional Documents
Culture Documents
-0.1385554
0.5143110
$code
[1] 2
$iterations
[1] 6
> optim(theta<-c(0.00007181,3.148,0.145,49.05),fn,hessian=TRUE)
Error in optim(theta <- c(7.181e-05, 3.148, 0.145, 49.05), fn, hessian = TRUE) :
non-finite finite-difference value [1]
In addition: Warning messages:
1: In log(theta[3]) : NaNs produced
2: In log(theta[3]) : NaNs produced
3: In log(theta[1]) : NaNs produced
4: In log(theta[3]) : NaNs produced
5: In log(theta[3]) : NaNs produced
6: In log(theta[3]) : NaNs produced
7: In log(theta[3]) : NaNs produced
> fit<-nlm(fn,theta<-c(0.00007181,3.148,0.145,49.05),hessian=TRUE)
There were 50 or more warnings (use warnings() to see the first 50)
> fit
$minimum
[1] -665.6488
$estimate
[1] 2.506924e-06 3.148000e+00 1.450000e-01 4.905000e+01
$gradient
[1] 1.646800e+07 2.089756e+01 3.452544e+02 -8.769015e+00
$hessian
[,1]
-1.460105e+10
-6.257459e+05
9.857123e+04
7.043540e+04
[1,]
[2,]
[3,]
[4,]
[,2]
[,3]
[,4]
-6.257459e+05 98571.2344971 70435.4015514
1.188304e+01
1.2374097
-5.2688981
1.237410e+00 -2374.8463605
-0.1385554
-5.268898e+00
-0.1385554
0.5143110
$code
[1] 2
$iterations
[1] 6
> fn<-function(theta,x){
+ n*(log(theta[1])+log(theta[2])+log(theta[3])+(1-theta[2])*log(theta[4])+theta[
1]*theta[4])+(theta[2]-1)*sum(log(x))+(1/(theta[4]^theta[2]))*sum(x^theta[2])-(t
heta[1]*theta[4])*sum(exp((x/theta[4])^theta[2]))+(theta[3]-1)*sum(1-(exp((theta
[1]*theta[4])*(1-(exp((x/theta[4])^theta[2]))))))
+ }
> nlm(fn,theta<-c(0.00007181,3.148,0.145,49.05),hessian=TRUE)
Error in f(x, ...) : argument "x" is missing, with no default
> nlm(fn,theta<-c(0.00007181,3.148,0.145,49.05),x=x,hessian=TRUE)
$minimum
[1] -665.6488
$estimate
[1] 2.506924e-06 3.148000e+00 1.450000e-01 4.905000e+01
$gradient
[1] 1.646800e+07 2.089756e+01 3.452544e+02 -8.769015e+00
$hessian
[,1]
-1.460105e+10
-6.257459e+05
9.857123e+04
7.043540e+04
[1,]
[2,]
[3,]
[4,]
[,2]
[,3]
[,4]
-6.257459e+05 98571.2344971 70435.4015514
1.188304e+01
1.2374097
-5.2688981
1.237410e+00 -2374.8463605
-0.1385554
-5.268898e+00
-0.1385554
0.5143110
$code
[1] 2
$iterations
[1] 6
There were 50 or more warnings (use warnings() to see the first 50)
> AIC(fit)
Error in UseMethod("logLik") :
no applicable method for 'logLik' applied to an object of class "list"
> summary(fit)
Length Class Mode
minimum
1
-none- numeric
estimate
4
-none- numeric
gradient
4
-none- numeric
hessian
16
-none- numeric
code
1
-none- numeric
iterations 1
-none- numeric
>