2
2
2
package:miscTools :
stdEr
Warning message:
package bbmle was built under R version 3.2.3
> logLikFun<-function(theta){-(n*(log(theta[1])+log(theta[2])+log(theta[3])+(1-t
heta[2])*log(theta[4])+theta[1]*theta[4])+(theta[2]-1)*sum(log(xi))+(1/(theta[4]
^theta[2]))*sum(xi^theta[2])-(theta[1]*theta[4])*sum(exp((xi/theta[4])^theta[2])
)+(theta[3]-1)*sum(1-(exp((theta[1]*theta[4])*(1-(exp((xi/theta[4])^theta[2]))))
)))}
> mle<-maxLik(logLik=logLikFun,start=c(0.00007181,3.148,0.145,49.05))
There were 50 or more warnings (use warnings() to see the first 50)
> summary(mle)
-------------------------------------------Maximum Likelihood estimation
Newton-Raphson maximisation, 1 iterations
Return code 3: Last step could not find a value above the current.
Boundary of parameter space?
Consider switching to a more robust optimisation method temporarily.
Log-Likelihood: 516.6791
4 free parameters
Estimates:
Estimate Std. error t value Pr(> t)
[1,] 7.181e-05
NA
NA
NA
[2,] 3.148e+00
NA
NA
NA
[3,] 1.450e-01
NA
NA
NA
[4,] 4.905e+01
NA
NA
NA
-------------------------------------------Warning messages:
1: In sqrt(diag(vc)) : NaNs produced
5),xi)
Error in mle2(logLikFun, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.1
45, :
some named arguments in 'start' are not arguments to the specified log-likelih
ood function
> m0<-mle2(logLikFun,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=49.0
5),data=xi)
Error in mle2(logLikFun, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.1
45, :
'data' must be a list
> m0<-mle2(logLikFun,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=49.0
5),xi=xi)
Error in mle2(logLikFun, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.1
45, :
some named arguments in 'start' are not arguments to the specified log-likelih
ood function
> m0<-maxLik(logLikFun,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=49
.05))
There were 50 or more warnings (use warnings() to see the first 50)
> summary(m0)
-------------------------------------------Maximum Likelihood estimation
Newton-Raphson maximisation, 1 iterations
Return code 3: Last step could not find a value above the current.
Boundary of parameter space?
Consider switching to a more robust optimisation method temporarily.
Log-Likelihood: 516.6791
4 free parameters
Estimates:
Estimate Std. error t value Pr(> t)
lambda 7.181e-05
NA
NA
NA
beta 3.148e+00
NA
NA
NA
gamma 1.450e-01
NA
NA
NA
aplha 4.905e+01
NA
NA
NA
-------------------------------------------Warning messages:
1: In sqrt(diag(vc)) : NaNs produced
2: In sqrt(diag(vc)) : NaNs produced
> logLikFun<-function(theta){
+ lambda=theta[1]
+ beta=theta[2]
+ gamma=theta[3]
+ alpha=theta[4]
+ (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(xi))+(1/(theta[4]^theta[2]))*sum(xi^theta[2])
-(theta[1]*theta[4])*sum(exp((xi/theta[4])^theta[2]))+(theta[3]-1)*sum(1-(exp((t
heta[1]*theta[4])*(1-(exp((xi/theta[4])^theta[2])))))))
+ }
> m0<-maxLik(logLikFun,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=49
.05))
There were 50 or more warnings (use warnings() to see the first 50)
> summary(m0)
-------------------------------------------Maximum Likelihood estimation
Newton-Raphson maximisation, 43 iterations
Return code 3: Last step could not find a value above the current.
Boundary of parameter space?
Consider switching to a more robust optimisation method temporarily.
Log-Likelihood: 2499507215
4 free parameters
Estimates:
Estimate Std. error t value Pr(> t)
lambda 6.056e-01
NA
NA
NA
beta 3.926e-03 2.195e-12 1.789e+09 <2e-16 ***
gamma 4.999e+07 1.448e-03 3.452e+10 <2e-16 ***
aplha 1.658e+01
NA
NA
NA
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1
1
-------------------------------------------Warning messages:
1: In sqrt(diag(vc)) : NaNs produced
2: In sqrt(diag(vc)) : NaNs produced
>
>
> library(stats4)
> LL<-function(theta){
+ lambda=theta[1]
+ beta=theta[2]
+ gamma=theta[3]
+ alpha=theta[4]
+ -(n*(log(theta[1])+log(theta[2])+log(theta[3])+(1-theta[2])*log(theta[4])+thet
a[1]*theta[4])+(theta[2]-1)*sum(log(xi))+(1/(theta[4]^theta[2]))*sum(xi^theta[2]
)-(theta[1]*theta[4])*sum(exp((xi/theta[4])^theta[2]))+(theta[3]-1)*sum(1-(exp((
theta[1]*theta[4])*(1-(exp((xi/theta[4])^theta[2])))))))
+ }
> mle(LL,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=49.05))
Error in mle(LL, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.145, :
'start' must be a named list
> mle(LL,start=list(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=49.05))
Error in mle(LL, start = list(lambda = 7.181e-05, beta = 3.148, gamma = 0.145,
:
some named arguments in 'start' are not arguments to the supplied log-likeliho
od
> mle(LL,start=list(lambda=0.00007181,beta=3.148,gamma=0.145,alpha=49.05))
Error in mle(LL, start = list(lambda = 7.181e-05, beta = 3.148, gamma = 0.145,
:
some named arguments in 'start' are not arguments to the supplied log-likeliho
od
> mle(LL,start=list(0.00007181,3.148,0.145,49.05))
Error in mle(LL, start = list(7.181e-05, 3.148, 0.145, 49.05)) :
'start' must be a named list
> mle(LL,start=c(0.00007181,3.148,0.145,49.05))
Error in mle(LL, start = c(7.181e-05, 3.148, 0.145, 49.05)) :
'start' must be a named list
> m0<-mle2(LL,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,alpha=49.05),data
=xi)
Error in mle2(LL, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.145, :
'data' must be a list
> m0<-mle2(LL,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,alpha=49.05))
Error in mle2(LL, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.145, :
some named arguments in 'start' are not arguments to the specified log-likelih
ood function
> m0<-mle2(LL,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,alpha=49.05),data
=list(xi))
Error in mle2(LL, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.145, :
some named arguments in 'start' are not arguments to the specified log-likelih
ood function
> xi<-data.frame(x=c(0.1,0.2,1,1,1,1,1,2,3,6,7,11,12,18,18,18,18,18,21,32,36,40,
45,46,47,50,55,60,63,63,67,67,67,67,72,75,79,82,82,83,84,84,84,85,85,85,85,85,86
,86)
+ )
> xi
x
1 0.1
2 0.2
3 1.0
4 1.0
5 1.0
6 1.0
7 1.0
8 2.0
9 3.0
10 6.0
11 7.0
12 11.0
13 12.0
14 18.0
15 18.0
16 18.0
17 18.0
18 18.0
19 21.0
20 32.0
21 36.0
22 40.0
23 45.0
24 46.0
25 47.0
26 50.0
27 55.0
28 60.0
29 63.0
30 63.0
31 67.0
32 67.0
33 67.0
34 67.0
35 72.0
36 75.0
37 79.0
38 82.0
39 82.0
40 83.0
41 84.0
42 84.0
43 84.0
44 85.0
45 85.0
46 85.0
47 85.0
48 85.0
49 86.0
50 86.0
> logLikFun<-function(theta){
+ lambda=theta[1]
+ beta=theta[2]
+ gamma=theta[3]
+ alpha=theta[4]
+ -(n*(log(theta[1])+log(theta[2])+log(theta[3])+(1-theta[2])*log(theta[4])+thet
a[1]*theta[4])+(theta[2]-1)*sum(log(xi))+(1/(theta[4]^theta[2]))*sum(xi^theta[2]
)-(theta[1]*theta[4])*sum(exp((xi/theta[4])^theta[2]))+(theta[3]-1)*sum(1-(exp((
theta[1]*theta[4])*(1-(exp((xi/theta[4])^theta[2])))))))
+ }
> fit<-mle2(logLikFun,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=49.
05),data=xi)
Error in mle2(logLikFun, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.1
45, :
some named arguments in 'start' are not arguments to the specified log-likelih
ood function
> fit<-mle2(logLikFun,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=49.
05))
Error in mle2(logLikFun, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.1
45, :
some named arguments in 'start' are not arguments to the specified log-likelih
ood function
> fit<-mle2(logLikFun,start=list(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=
49.05),data=xi)
Error in mle2(logLikFun, start = list(lambda = 7.181e-05, beta = 3.148, :
some named arguments in 'start' are not arguments to the specified log-likelih
ood function
> fit<-mle2(logLikFun,start=c(0.00007181,3.148,0.145,49.05))
Error in mle2(logLikFun, start = c(7.181e-05, 3.148, 0.145, 49.05)) :
'start' must be a named vector or named list
> xi=c((0.1,0.2,1,1,1,1,1,2,3,6,7,11,12,18,18,18,18,18,21,32,36,40,45,46,47,50,5
5,60,63,63,67,67,67,67,72,75,79,82,82,83,84,84,84,85,85,85,85,85,86,86)
Error: unexpected ',' in "xi=c((0.1,"
> xi=c(0.1,0.2,1,1,1,1,1,2,3,6,7,11,12,18,18,18,18,18,21,32,36,40,45,46,47,50,55
,60,63,63,67,67,67,67,72,75,79,82,82,83,84,84,84,85,85,85,85,85,86,86)
> n<-length(xi)
> logLikFun<-function(theta){
+ lambda=theta[1]
+ beta=theta[2]
+ gamma=theta[3]
+ alpha=theta[4]
+ -(n*(log(theta[1])+log(theta[2])+log(theta[3])+(1-theta[2])*log(theta[4])+thet
a[1]*theta[4])+(theta[2]-1)*sum(log(xi))+(1/(theta[4]^theta[2]))*sum(xi^theta[2]
)-(theta[1]*theta[4])*sum(exp((xi/theta[4])^theta[2]))+(theta[3]-1)*sum(1-(exp((
theta[1]*theta[4])*(1-(exp((xi/theta[4])^theta[2])))))))
+ }
> mle(logLikFun,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,aplha=49.05),me
thod="NR")
Error in mle(logLikFun, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.14
5, :
'start' must be a named list
> mle(logLikFun,start=c(lambda=0.00007181,beta=3.148,gamma=0.145,alpha=49.05),me
thod="NR")
Error in mle(logLikFun, start = c(lambda = 7.181e-05, beta = 3.148, gamma = 0.14
5, :
'start' must be a named list
> mle(logLikFun,start=list(lambda=0.00007181,beta=3.148,gamma=0.145,alpha=49.05)
,method="NR")
Error in mle(logLikFun, start = list(lambda = 7.181e-05, beta = 3.148, :
some named arguments in 'start' are not arguments to the supplied log-likeliho
od
> mle(logLikFun,start=c(0.00007181,3.148,0.145,49.05),method="NR")
Error in mle(logLikFun, start = c(7.181e-05, 3.148, 0.145, 49.05), method = "NR"
) :
'start' must be a named list
> mle(logLikFun,start=list(0.00007181,3.148,0.145,49.05),method="NR")
Error in mle(logLikFun, start = list(7.181e-05, 3.148, 0.145, 49.05), :