You are on page 1of 3

> xi=c(1,2,3,4,5,6,7,8,9,10)

Warning messages:
1: package maxLik was built under R version 3.2.3
2: package miscTools was built under R version 3.2.3
> theta=c(0.00007181,3.148,0.145,49.05)
> theta[1]
[1] 7.181e-05
> pdf<-function(theta){theta[1]*theta[2]*theta[3]*((xi/theta[4])^(theta[2]-1))*(
exp(((xi/theta[4])^theta[2])+(theta[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))
))*(1-(exp(theta[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))))^(theta[3]-1)}
> pdf
function(theta){theta[1]*theta[2]*theta[3]*((xi/theta[4])^(theta[2]-1))*(exp(((x
i/theta[4])^theta[2])+(theta[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))))*(1-(
exp(theta[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))))^(theta[3]-1)}
> theta[1]*theta[2]*theta[3]*((xi/theta[4])^(theta[2]-1))*(exp(((xi/theta[4])^th
eta[2])+(theta[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))))*(1-(exp(theta[1]*t
heta[4]*(1-(exp(xi/theta[4])^theta[2])))))^(theta[3]-1)
[1] 9.754431e-06 2.324242e-05 3.816934e-05 5.381775e-05 6.979629e-05 8.585644e05
[7] 1.018291e-04 1.175956e-04 1.330722e-04 1.482007e-04
> pdf<-theta[1]*theta[2]*theta[3]*((xi/theta[4])^(theta[2]-1))*(exp(((xi/theta[4
])^theta[2])+(theta[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))))*(1-(exp(theta
[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))))^(theta[3]-1)
> plot(xi,pdf)
> 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)
> pdf
[1] 9.754431e-06 2.324242e-05 3.816934e-05 5.381775e-05 6.979629e-05 8.585644e05
[7] 1.018291e-04 1.175956e-04 1.330722e-04 1.482007e-04
> pdf<-theta[1]*theta[2]*theta[3]*((xi/theta[4])^(theta[2]-1))*(exp(((xi/theta[4
])^theta[2])+(theta[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))))*(1-(exp(theta
[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))))^(theta[3]-1)
> pdf
[1] 5.093771e-07 1.244721e-06 9.754431e-06 9.754431e-06 9.754431e-06 9.754431e06
[7] 9.754431e-06 2.324242e-05 3.816934e-05 8.585644e-05 1.018291e-04 1.629425e04
[13] 1.772745e-04 2.546822e-04 2.546822e-04 2.546822e-04 2.546822e-04 2.546822e04
[19] 2.887439e-04 4.075998e-04 4.585911e-04 5.213802e-04 6.276666e-04 6.542025e04
[25] 6.829785e-04 7.854481e-04 1.032107e-03 1.436811e-03 1.807310e-03 1.807310e03
[31] 2.551578e-03 2.551578e-03 2.551578e-03 2.551578e-03 4.195751e-03 5.865649e03
[37] 9.573590e-03 1.427159e-02 1.427159e-02 1.639904e-02 1.889711e-02 1.889711e02
[43] 1.889711e-02 2.183584e-02 2.183584e-02 2.183584e-02 2.183584e-02 2.183584e02
[49] 2.529896e-02 2.529896e-02
> plot(xi,pdf)
> hist(Xi, main="Probability Density Function", right=FALSE, prob=TRUE)
Error in hist(Xi, main = "Probability Density Function", right = FALSE, :
object 'Xi' not found
> hist(xi, main="Probability Density Function", right=FALSE, prob=TRUE)
> hist(xi, main="Probability Density Function", right=TRUE, prob=TRUE)
> hist(xi, main="Probability Density Function", right=FALSE, prob=TRUE)
> hist(xi, main="Probability Density Function", right=TRUE, prob=TRUE)
> hist(xi, main="Probability Density Function", right=FALSE, prob=TRUE)

> hist(xi, main="Probability Density Function", prob=TRUE)


> hist(xi, main="Probability Density Function", right=FALSE, prob=TRUE)
> plot.ecdf(xi,ylab="F(x)",verticals = FALSE,col.01line = "gray70",pch=19)
> plot(xi, pdf, type="n", xlab="lifetime", ylab="",main="EMWE Distribution", axe
s=FALSE)
> plot(xi, pdf, type="n", xlab="lifetime", ylab="",main="EMWE Distribution", axe
s=TRUE)
> plot(xi, pdf, type="n", xlab="lifetime", ylab="probability",main="EMWE Distrib
ution", axes=TRUE)
> plot(xi, pdf, type="n", xlab="lifetime", ylab="probability",main="EMWE Distrib
ution", axes=TRUE)
> pdf
[1] 5.093771e-07 1.244721e-06 9.754431e-06 9.754431e-06 9.754431e-06 9.754431e06
[7] 9.754431e-06 2.324242e-05 3.816934e-05 8.585644e-05 1.018291e-04 1.629425e04
[13] 1.772745e-04 2.546822e-04 2.546822e-04 2.546822e-04 2.546822e-04 2.546822e04
[19] 2.887439e-04 4.075998e-04 4.585911e-04 5.213802e-04 6.276666e-04 6.542025e04
[25] 6.829785e-04 7.854481e-04 1.032107e-03 1.436811e-03 1.807310e-03 1.807310e03
[31] 2.551578e-03 2.551578e-03 2.551578e-03 2.551578e-03 4.195751e-03 5.865649e03
[37] 9.573590e-03 1.427159e-02 1.427159e-02 1.639904e-02 1.889711e-02 1.889711e02
[43] 1.889711e-02 2.183584e-02 2.183584e-02 2.183584e-02 2.183584e-02 2.183584e02
[49] 2.529896e-02 2.529896e-02
> plot(xi, pdf, type="m", xlab="lifetime", ylab="probability",main="EMWE Distrib
ution", axes=TRUE)
Error in plot.xy(xy, type, ...) : invalid plot type 'm'
> plot(xi, pdf, type="1", xlab="lifetime", ylab="probability",main="EMWE Distrib
ution", axes=TRUE)
Error in plot.xy(xy, type, ...) : invalid plot type '1'
> plot(xi, pdf, type="l", lty=2, xlab="lifetime", ylab="probability",main="EMWE
Distribution", axes=TRUE)
> kum<-(1-(exp(theta[1]*theta[4]*(1-(exp(xi/theta[4])^theta[2])))))^(theta[3])
> kum
[1] 0.2121111 0.2346466 0.2974309 0.2974309 0.2974309 0.2974309 0.2974309 0.330
4310
[9] 0.3521117 0.3950526 0.4059872 0.4423652 0.4503109 0.4931430 0.4931430 0.493
1430
[17] 0.4931430 0.4931430 0.5127437 0.5810631 0.6056212 0.6303668 0.6617286 0.668
0688
[25] 0.6744331 0.6936721 0.7262132 0.7592647 0.7792607 0.7792607 0.8059762 0.805
9762
[33] 0.8059762 0.8059762 0.8391347 0.8586769 0.8839804 0.9021340 0.9021340 0.907
9838
[41] 0.9137180 0.9137180 0.9137180 0.9193271 0.9193271 0.9193271 0.9193271 0.919
3271
[49] 0.9248016 0.9248016
> hazard=pdf/(1-kum)
> hazard
[1] 6.465088e-07 1.626335e-06 1.388395e-05 1.388395e-05 1.388395e-05 1.388395e05
[7] 1.388395e-05 3.471251e-05 5.891345e-05 1.419238e-04 1.714257e-04 2.922030e04
[13] 3.224997e-04 5.024734e-04 5.024734e-04 5.024734e-04 5.024734e-04 5.024734e04

[19] 5.925914e-04 9.729385e-04 1.162819e-03 1.410534e-03 1.855512e-03 1.970898e03


[25] 2.097813e-03 2.564076e-03 3.769746e-03 5.968429e-03 8.187532e-03 8.187532e03
[31] 1.315085e-02 1.315085e-02 1.315085e-02 1.315085e-02 2.608238e-02 4.150522e02
[37] 8.251698e-02 1.458278e-01 1.458278e-01 1.782192e-01 2.190156e-01 2.190156e01
[43] 2.190156e-01 2.706711e-01 2.706711e-01 2.706711e-01 2.706711e-01 2.706711e01
[49] 3.364294e-01 3.364294e-01
> plot(xi, hazard, type="l", lty=2, xlab="lifetime", ylab="probability",main="EM
WE Distribution", axes=TRUE)

You might also like