options(warn = -1)
library(readxl)

source('functions.R')
## Loading required package: survival
Sys.setlocale(category = "LC_ALL", locale = "Hebrew")
## [1] "LC_COLLATE=Hebrew_Israel.1255;LC_CTYPE=Hebrew_Israel.1255;LC_MONETARY=Hebrew_Israel.1255;LC_NUMERIC=C;LC_TIME=Hebrew_Israel.1255"
a18 <- read.csv("~/1R/Otzma/Otzma 2018 results.csv", stringsAsFactors=FALSE)
a17 <- read.csv("~/1R/Otzma/Otzma 2017 results.csv", stringsAsFactors=FALSE)
a18$call_date=as.Date.character(a18$call_date,"%d-%m-%y") # only for 2018
a18$start_date=as.Date.character(a18$start_date,"%d-%m-%y") # only for 2018
a18$finish_date=as.Date.character(a18$finish_date,"%d-%m-%y") # only for 2018
#a17$call_date=as.Date.character(a17$call_date) # only for 2017 option 2
#a17$start_date=as.Date.character(a17$start_date) # only for 2017 option 2
#a17$finish_date=as.Date.character(a17$finish_date,"%d/%m/%y") # only for 2017 option 2
a17$call_date=as.Date.character(a17$call_date,"%d-%m-%y") # only for 2017
a17$start_date=as.Date.character(a17$start_date,"%d-%m-%y") # only for 2017
a17$finish_date=as.Date.character(a17$finish_date,"%d-%m-%y") # only for 2017


au0 <- a17[,c(3,5:19)] # for 2017
au0 = rbind(au0,a18[,c(3,5:19)]) # add 2018

au1=au0[au0$machine=="auto",]
au1=au1[order(au1$start_date),]
au1=au1[!is.na(au1$responsibility),]
au1$responsibility=as.factor(au1$responsibility)

fn="dt auto results 2017&2018 17-17-2018.txt" 
origin=as.numeric(as.Date.character(c("1984-01-01","1988-01-01","1996-01-01","2014-01-01")))

f=file(description = fn, open = "wt", encoding = "UTF-8")
o.ix=1
for (x in c("1","2","3","4")) {
  m1=au1[au1$machine_ix==x,]
  m1=data.frame(m1,dt=rep(0,length(m1[[1]])), ttr=rep(0,length(m1[[1]])))
  sum1=summary(m1$responsibility)
  for (i in 1:length(sum1)) {
    t1=names(sum1[i])
    m_=m1[m1$responsibility==t1,]
    n=length(m_$machine)
    if (n<3) next
    m = build_dt1(m_)
    t<-"delta-T Fit "
    t=paste(t,m$machine[1],m$machine_ix[1],t1)
    print(t)
    write(t, f)
    write(paste("TTFF,",(as.numeric(m$dt[1])-origin[o.ix])),f)
    m$dt[1]=1
    #m=m[2:length(m[[1]]),]
    n=length(m$machine)
    e=NULL
    if (n>3) {
      e=compare_discrete(m,paste("Discrete",t))
    } 
    if (n>2) {
      e=rbind(e,compare_conti(m,paste("Continuous",t)) )
      #e=compare_conti(m,paste("Continuous",t))
    }
    if (!is.null(e)) write.csv(e[order(e[,1], e[,2]),], f)
    if (n>3) {
      e=fit_dt(m,t)
      write(paste("MEAN,",e$mean),f)
      write(paste("SD,",e$sd),f)
      write(paste("SKEWNESS,",e$skewness),f)
      write(paste("KUROSIS,",e$kurtosis),f)
    }
  }
  o.ix=o.ix+1
}
## [1] "delta-T Fit  auto 1 בקרות"
## [1] "Discrete delta-T Fit  auto 1 בקרות"
## [1] "P-L GoF: 0.244750035612708"
## [1] "P-L xmin: 7"
## [1] "P-L pars: 1.65"

## [1] "L-N GoF: 0.157021046162684"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 2.02636714087405" "L-N pars: 2.27528626908035"
## [1] "LogNormal fit: 2.55525794481796 - -18.3437450510441"
## [2] "LogNormal fit: 1.84363614021305 - -18.3437450510441"
## [1] "Exponential fit: 0.0210526315789474 - -19.4429188441624"
## [1] "Poisson GoF: 0.666666622512006"
## [1] "Poisson xmin: 7"
## [1] "Poisson pars: 62.9999995527543"
## [1] "Exp GoF: 0.361526175593395"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.0212928342477317"
## [1] "Continuous delta-T Fit  auto 1 בקרות"
## [1] "P-L GoF: 0.245874679461505"
## [1] "P-L xmin: 7"
## [1] "P-L pars: 1.68"

## [1] "L-N GoF: 0.149673012903423"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 3.38964171729031" "L-N pars: 1.2997072826717" 
## [1] "Weibull GoF: 0.149411614208545"
## [1] "Weibull xmin: 1"
## [1] "Weibull pars: 0.758273801615815" "Weibull pars: 50.951413459027"  
## [1] "Exp GoF: 0.205842831580307"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.02"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  157 
## median:  16 
## mean:  47.5 
## estimated sd:  73.70889 
## estimated skewness:  1.888771 
## estimated kurtosis:  6.595868 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.6079664  0.2375275
## scale 32.1230546 27.9674516
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.555258  0.9218181
## sdlog   1.843636  0.6518229
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate Std. Error
## rate 0.02105263  0.0105025

## <simpleError in ans[!test & ok] <- rep(no, length.out = length(ans))[!test &     ok]: replacement has length zero>
## NULL
## NULL
## NULL
## NULL
## [1] "delta-T Fit  auto 1 חשמל"
## [1] "Discrete delta-T Fit  auto 1 חשמל"
## [1] "P-L GoF: 0.153933597096923"
## [1] "P-L xmin: 16"
## [1] "P-L pars: 2.57"

## [1] "L-N GoF: 0.108996860379931"
## [1] "L-n xmin: 17"
## [1] "L-N pars: 3.0574981737805"   "L-N pars: 0.732668606819366"
## [1] "LogNormal fit: 2.90104929172511 - -74.5282741841036"
## [2] "LogNormal fit: 1.06612257338474 - -74.5282741841036"
## [1] "Exponential fit: 0.0367170626349892 - -73.1767330705103"
## [1] "Poisson GoF: 0.279663830371396"
## [1] "Poisson xmin: 37"
## [1] "Poisson pars: 59.2304784593393"
## [1] "Exp GoF: 0.104389357589228"
## [1] "Exp xmin: 17"
## [1] "Exp pars: 0.0481562681109042"
## [1] "Continuous delta-T Fit  auto 1 חשמל"
## [1] "P-L GoF: 0.163625555621107"
## [1] "P-L xmin: 16"
## [1] "P-L pars: 2.65"

## [1] "L-N GoF: 0.0732155400470903"
## [1] "L-n xmin: 3"
## [1] "L-N pars: 3.21344791435122"  "L-N pars: 0.643942636347972"
## [1] "Weibull GoF: 0.0799698486810679"
## [1] "Weibull xmin: 1"
## [1] "Weibull pars: 1.40148952587448" "Weibull pars: 31.5188807852311"
## [1] "Exp GoF: 0.115490106413645"
## [1] "Exp xmin: 17"
## [1] "Exp pars: 0.05"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  88 
## median:  22 
## mean:  27.23529 
## estimated sd:  22.28937 
## estimated skewness:  1.429026 
## estimated kurtosis:  5.308873 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##        estimate Std. Error
## shape  1.245317  0.2371678
## scale 29.165578  5.9695205
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.901049  0.2585727
## sdlog   1.066123  0.1828378
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate  Std. Error
## rate 0.03671706 0.008898585

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm  3-mle-exp
## Kolmogorov-Smirnov statistic    0.14186207   0.2167521 0.20897605
## Cramer-von Mises statistic      0.03189279   0.0955830 0.08856531
## Anderson-Darling statistic      0.20784731   0.5874893 0.44403045
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      149.1622    153.0565  148.3535
## Bayesian Information Criterion      150.8286    154.7230  149.1867
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.7781207     0.5219686     0.6827553 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.1418621     0.2167521     0.2089760 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      149.1622      153.0565      148.3535 
## [1] "delta-T Fit  auto 1 מכונות"
## [1] "Discrete delta-T Fit  auto 1 מכונות"
## [1] "P-L GoF: 0.116421595404178"
## [1] "P-L xmin: 5"
## [1] "P-L pars: 2.21"

## [1] "L-N GoF: 0.0726948227697234"
## [1] "L-n xmin: 7"
## [1] "L-N pars: 2.6169530371257"   "L-N pars: 0.629466227845503"
## [1] "LogNormal fit: 1.60107884403413 - -176.837272205946"
## [2] "LogNormal fit: 1.08588020513049 - -176.837272205946"
## [1] "Exponential fit: 0.116326530612245 - -179.627185026397"
## [1] "Poisson GoF: 0.28540729178023"
## [1] "Poisson xmin: 17"
## [1] "Poisson pars: 28.2544888137449"
## [1] "Exp GoF: 0.0875063006103693"
## [1] "Exp xmin: 15"
## [1] "Exp pars: 0.0885534347531008"
## [1] "Continuous delta-T Fit  auto 1 מכונות"
## [1] "P-L GoF: 0.15173264318833"
## [1] "P-L xmin: 25"
## [1] "P-L pars: 4.73"

## [1] "L-N GoF: 0.062747690227876"
## [1] "L-n xmin: 7"
## [1] "L-N pars: 2.67312707899025"  "L-N pars: 0.598238234275379"
## [1] "Weibull GoF: 0.0659300890872191"
## [1] "Weibull xmin: 15"
## [1] "Weibull pars: 1.23931292032679" "Weibull pars: 16.4171607293465"
## [1] "Exp GoF: 0.0934303402594008"
## [1] "Exp xmin: 15"
## [1] "Exp pars: 0.09"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  53 
## median:  6 
## mean:  8.596491 
## estimated sd:  9.854041 
## estimated skewness:  2.3989 
## estimated kurtosis:  10.14171 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##        estimate Std. Error
## shape 0.9796134  0.0966902
## scale 8.5123327  1.2197285
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 1.601079  0.1438283
## sdlog   1.085880  0.1017016
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##       estimate Std. Error
## rate 0.1163265 0.01540669

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm 3-mle-exp
## Kolmogorov-Smirnov statistic     0.1408144   0.1403464 0.1467226
## Cramer-von Mises statistic       0.1320626   0.1259226 0.1420328
## Anderson-Darling statistic       0.9493647   1.0435624 0.9942591
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      363.2108    357.6745  361.2544
## Bayesian Information Criterion      367.2969    361.7606  363.2974
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##  3.904367e-04  2.226882e-06  7.488598e-04 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.1408144     0.1403464     0.1467226 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      363.2108      357.6745      361.2544 
## [1] "delta-T Fit  auto 2 בקרות"
## [1] "Discrete delta-T Fit  auto 2 בקרות"
## [1] "P-L GoF: 0.310700662474131"
## [1] "P-L xmin: 1"
## [1] "P-L pars: 1.5"

## [1] "L-N GoF: 0.208447578581985"
## [1] "L-n xmin: 1"
## [1] "L-N pars: -1.75754132459045" "L-N pars: 4.24339584635432" 
## [1] "LogNormal fit: 2.39536459796934 - -23.2331739680387"
## [2] "LogNormal fit: 2.29867222425276 - -23.2331739680387"
## [1] "Exponential fit: 0.0128205128205128 - -26.783544133448"
## [1] "Poisson GoF: 0.6"
## [1] "Poisson xmin: 1"
## [1] "Poisson pars: 78.0000000003126"
## [1] "Exp GoF: 0.325184672657231"
## [1] "Exp xmin: 7"
## [1] "Exp pars: 0.0081820424798519"
## [1] "Continuous delta-T Fit  auto 2 בקרות"
## [1] "P-L GoF: 0.283752361256181"
## [1] "P-L xmin: 1"
## [1] "P-L pars: 1.5"

## [1] "L-N GoF: 0.302662821590182"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 3.96283291063235" "L-N pars: 1.59647360904097"
## [1] "Weibull GoF: 0.29821483276613"
## [1] "Weibull xmin: 1"
## [1] "Weibull pars: 0.722118479395643" "Weibull pars: 104.232003129637" 
## [1] "Exp GoF: 0.28354626496547"
## [1] "Exp xmin: 7"
## [1] "Exp pars: 0.01"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  307 
## median:  7 
## mean:  78 
## estimated sd:  131.6776 
## estimated skewness:  1.95963 
## estimated kurtosis:  6.832124 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.4668325  0.1625639
## scale 35.3939350 35.9532908
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.395365  1.0279975
## sdlog   2.298672  0.7269034
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate  Std. Error
## rate 0.01282051 0.005698374

## <simpleError in ans[!test & ok] <- rep(no, length.out = length(ans))[!test &     ok]: replacement has length zero>
## NULL
## NULL
## NULL
## NULL
## [1] "delta-T Fit  auto 2 חשמל"
## [1] "Discrete delta-T Fit  auto 2 חשמל"
## [1] "P-L GoF: 0.249267027770371"
## [1] "P-L xmin: 14"
## [1] "P-L pars: 2.23"

## [1] "L-N GoF: 0.281085375741761"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 2.8771924577632" "L-N pars: 1.567550542714" 
## [1] "LogNormal fit: 2.92839733170602 - -33.2718882987629"
## [2] "LogNormal fit: 1.50048896988649 - -33.2718882987629"
## [1] "Exponential fit: 0.0201729106628242 - -34.3239024162408"
## [1] "Poisson GoF: 0.749999635365324"
## [1] "Poisson xmin: 21"
## [1] "Poisson pars: 79.4999999711146"
## [1] "Exp GoF: 0.365917865702896"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.0203940505338413"
## [1] "Continuous delta-T Fit  auto 2 חשמל"
## [1] "P-L GoF: 0.166666666666667"
## [1] "P-L xmin: 14"
## [1] "P-L pars: 2.29"

## [1] "L-N GoF: 0.218953512505899"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 3.41555068923998"  "L-N pars: 0.981004793730888"
## [1] "Weibull GoF: 0.189614404257679"
## [1] "Weibull xmin: 1"
## [1] "Weibull pars: 0.791568838049047" "Weibull pars: 47.0081842085904" 
## [1] "Exp GoF: 0.241748617464211"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.02"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  237 
## median:  21 
## mean:  49.57143 
## estimated sd:  83.43032 
## estimated skewness:  2.5441 
## estimated kurtosis:  9.583915 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.7192447  0.2001506
## scale 38.7776593 21.5895307
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.928397  0.5671315
## sdlog   1.500489  0.4010217
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate  Std. Error
## rate 0.02017291 0.007605853

## <simpleError in ans[!test & ok] <- rep(no, length.out = length(ans))[!test &     ok]: replacement has length zero>
## NULL
## NULL
## NULL
## NULL
## [1] "delta-T Fit  auto 2 מכונות"
## [1] "Discrete delta-T Fit  auto 2 מכונות"
## [1] "P-L GoF: 0.147088634785049"
## [1] "P-L xmin: 27"
## [1] "P-L pars: 3.48"

## [1] "L-N GoF: 0.0978010276773866"
## [1] "L-n xmin: 2"
## [1] "L-N pars: 2.5658804180186"  "L-N pars: 1.03260187357445"
## [1] "LogNormal fit: 2.40429212508631 - -99.6613067251308"
## [2] "LogNormal fit: 1.17729756253501 - -99.6613067251308"
## [1] "Exponential fit: 0.0521920668058455 - -98.8206193135679"
## [1] "Poisson GoF: 0.24065850456164"
## [1] "Poisson xmin: 39"
## [1] "Poisson pars: 52.635681674216"
## [1] "Exp GoF: 0.0718817754820464"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.0536096128708526"
## [1] "Continuous delta-T Fit  auto 2 מכונות"
## [1] "P-L GoF: 0.126891572955713"
## [1] "P-L xmin: 48"
## [1] "P-L pars: 5"

## [1] "L-N GoF: 0.08947975521427"
## [1] "L-n xmin: 4"
## [1] "L-N pars: 2.88435051024367"  "L-N pars: 0.791068843068454"
## [1] "Weibull GoF: 0.0657476676314122"
## [1] "Weibull xmin: 2"
## [1] "Weibull pars: 1.04929694307603" "Weibull pars: 20.2300782058124"
## [1] "Exp GoF: 0.0618026950957573"
## [1] "Exp xmin: 2"
## [1] "Exp pars: 0.05"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  69 
## median:  14 
## mean:  19.16 
## estimated sd:  18.37498 
## estimated skewness:  1.273888 
## estimated kurtosis:  4.066713 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##       estimate Std. Error
## shape  1.02635  0.1621479
## scale 19.36379  3.9809816
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.404292  0.2354595
## sdlog   1.177298  0.1664945
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate Std. Error
## rate 0.05219207 0.01043458

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm  3-mle-exp
## Kolmogorov-Smirnov statistic    0.07949005   0.1142723 0.07565786
## Cramer-von Mises statistic      0.02659541   0.0509552 0.02288441
## Anderson-Darling statistic      0.18426105   0.3472433 0.16418729
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      201.6146    203.3226  199.6412
## Bayesian Information Criterion      204.0523    205.7604  200.8601
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.6201281     0.4281839     0.8120404 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##    0.07949005    0.11427225    0.07565786 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      201.6146      203.3226      199.6412 
## [1] "delta-T Fit  auto 2 מסגרות"
## [1] "Discrete delta-T Fit  auto 2 מסגרות"
## [1] "P-L GoF: 0.206191334776258"
## [1] "P-L xmin: 49"
## [1] "P-L pars: 3.55"

## [1] "L-N GoF: 0.141059353142267"
## [1] "L-n xmin: 21"
## [1] "L-N pars: 3.96686644444504" "L-N pars: 0.54862364322142"
## [1] "LogNormal fit: 3.41869893997809 - -46.2826913227479"
## [2] "LogNormal fit: 1.3564673518572 - -46.2826913227479" 
## [1] "Exponential fit: 0.02 - -44.2082070488533"
## [1] "Poisson GoF: 0.325850805538457"
## [1] "Poisson xmin: 70"
## [1] "Poisson pars: 87.4762230569896"
## [1] "Exp GoF: 0.153376572539941"
## [1] "Exp xmin: 41"
## [1] "Exp pars: 0.0351007425268931"
## [1] "Continuous delta-T Fit  auto 2 מסגרות"
## [1] "P-L GoF: 0.21175607106009"
## [1] "P-L xmin: 49"
## [1] "P-L pars: 3.62"

## [1] "L-N GoF: 0.0897308048540316"
## [1] "L-n xmin: 41"
## [1] "L-N pars: 4.24918375417033" "L-N pars: 0.29943108251901"
## [1] "Weibull GoF: 0.0879520765768276"
## [1] "Weibull xmin: 14"
## [1] "Weibull pars: 2.35279974221394" "Weibull pars: 68.7484304603454"
## [1] "Exp GoF: 0.16725174762601"
## [1] "Exp xmin: 14"
## [1] "Exp pars: 0.02"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  108 
## median:  49 
## mean:  50 
## estimated sd:  34.96427 
## estimated skewness:  0.2306499 
## estimated kurtosis:  2.250493 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##        estimate Std. Error
## shape  1.237734  0.3568443
## scale 52.840338 14.7717787
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 3.418699  0.4521558
## sdlog   1.356467  0.3197216
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##      estimate  Std. Error
## rate     0.02 0.006649951

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm  3-mle-exp
## Kolmogorov-Smirnov statistic    0.18500189   0.2527118 0.22623501
## Cramer-von Mises statistic      0.04656076   0.1195568 0.07786694
## Anderson-Darling statistic      0.37111682   0.7784509 0.44739618
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      91.91449    96.56538  90.41641
## Bayesian Information Criterion      92.30894    96.95983  90.61364
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.4226669     0.2184666     0.6902695 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.1850019     0.2527118     0.2262350 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      91.91449      96.56538      90.41641 
## [1] "delta-T Fit  auto 3 בקרות"
## [1] "Discrete delta-T Fit  auto 3 בקרות"
## [1] "P-L GoF: 0.180375865761904"
## [1] "P-L xmin: 3"
## [1] "P-L pars: 1.5"

## [1] "L-N GoF: 0.151638390656832"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 1.1936312968795"  "L-N pars: 2.60645133705348"
## [1] "LogNormal fit: 2.26921550243527 - -38.9229614369855"
## [2] "LogNormal fit: 1.89008056917948 - -38.9229614369855"
## [1] "Exponential fit: 0.0182926829268293 - -45.0112872524048"
## [1] "Poisson GoF: 0.5"
## [1] "Poisson xmin: 9"
## [1] "Poisson pars: 118.749999984305"
## [1] "Exp GoF: 0.432286406828329"
## [1] "Exp xmin: 15"
## [1] "Exp pars: 0.0071468494607506"
## [1] "Continuous delta-T Fit  auto 3 בקרות"
## [1] "P-L GoF: 0.191032679116465"
## [1] "P-L xmin: 3"
## [1] "P-L pars: 1.55"

## [1] "L-N GoF: 0.180825591776379"
## [1] "L-n xmin: 3"
## [1] "L-N pars: 1.29617439687461" "L-N pars: 2.5675887699277" 
## [1] "Weibull GoF: 0.183851030149235"
## [1] "Weibull xmin: 3"
## [1] "Weibull pars: 0.266570888359987" "Weibull pars: 2.32699704112578" 
## [1] "Exp GoF: 0.358056432495125"
## [1] "Exp xmin: 3"
## [1] "Exp pars: 0.02"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  233 
## median:  6 
## mean:  54.66667 
## estimated sd:  97.0219 
## estimated skewness:  1.617828 
## estimated kurtosis:  3.763632 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.5122415  0.1265051
## scale 26.1859716 18.1264551
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.269216  0.6300269
## sdlog   1.890081  0.4454957
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate  Std. Error
## rate 0.01829268 0.006079275

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm 3-mle-exp
## Kolmogorov-Smirnov statistic     0.2493383  0.18597775 0.5378132
## Cramer-von Mises statistic       0.1187965  0.07237639 0.7883229
## Anderson-Darling statistic       0.7224708  0.51475310 5.3301062
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      84.07210    81.84592  92.02257
## Bayesian Information Criterion      84.46654    82.24037  92.21980
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##  1.259776e-01  1.820961e-01  1.833544e-07 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.2493383     0.1859777     0.5378132 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      84.07210      81.84592      92.02257 
## [1] "delta-T Fit  auto 3 חשמל"
## [1] "Discrete delta-T Fit  auto 3 חשמל"
## [1] "P-L GoF: 0.196731751691836"
## [1] "P-L xmin: 43"
## [1] "P-L pars: 2.7"

## [1] "L-N GoF: 0.135855542988738"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 2.87980008911805" "L-N pars: 1.48146021190698"
## [1] "LogNormal fit: 2.91426008384565 - -56.3375155821167"
## [2] "LogNormal fit: 1.43561646331797 - -56.3375155821167"
## [1] "Exponential fit: 0.0245901639344262 - -56.4649050727818"
## [1] "Poisson GoF: 0.333307715859917"
## [1] "Poisson xmin: 70"
## [1] "Poisson pars: 107.66487334109"
## [1] "Exp GoF: 0.179572829308919"
## [1] "Exp xmin: 20"
## [1] "Exp pars: 0.0184788781039444"
## [1] "Continuous delta-T Fit  auto 3 חשמל"
## [1] "P-L GoF: 0.199943536765749"
## [1] "P-L xmin: 43"
## [1] "P-L pars: 2.73"

## [1] "L-N GoF: 0.0967000338048302"
## [1] "L-n xmin: 5"
## [1] "L-N pars: 3.45153835792492" "L-N pars: 1.06996539648361"
## [1] "Weibull GoF: 0.0859059075017781"
## [1] "Weibull xmin: 4"
## [1] "Weibull pars: 0.774613030436077" "Weibull pars: 35.1275082835832" 
## [1] "Exp GoF: 0.104384919136899"
## [1] "Exp xmin: 7"
## [1] "Exp pars: 0.02"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  144 
## median:  18 
## mean:  40.66667 
## estimated sd:  46.29222 
## estimated skewness:  1.331765 
## estimated kurtosis:  3.939946 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.8281282  0.1894059
## scale 36.7654038 13.5342880
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.914260  0.4144268
## sdlog   1.435616  0.2930433
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate  Std. Error
## rate 0.02459016 0.007086807

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm 3-mle-exp
## Kolmogorov-Smirnov statistic    0.12995545  0.13905414 0.1948560
## Cramer-von Mises statistic      0.03371367  0.02855455 0.0926241
## Anderson-Darling statistic      0.20486879  0.20612309 0.5532344
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      116.1892    116.6750  114.9298
## Bayesian Information Criterion      117.1590    117.6448  115.4147
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.3523428     0.4470762     0.2454598 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.1299555     0.1390541     0.1948560 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      116.1892      116.6750      114.9298 
## [1] "delta-T Fit  auto 3 מכונות"
## [1] "Discrete delta-T Fit  auto 3 מכונות"
## [1] "P-L GoF: 0.151618493577895"
## [1] "P-L xmin: 11"
## [1] "P-L pars: 2.31"

## [1] "L-N GoF: 0.0573575509661147"
## [1] "L-n xmin: 2"
## [1] "L-N pars: 2.34431352982846" "L-N pars: 1.03372902570942"
## [1] "LogNormal fit: 2.23943113692449 - -101.795605404304"
## [2] "LogNormal fit: 1.1183316062725 - -101.795605404304" 
## [1] "Exponential fit: 0.0616438356164384 - -102.232315198047"
## [1] "Poisson GoF: 0.387525239994075"
## [1] "Poisson xmin: 29"
## [1] "Poisson pars: 46.5532682852905"
## [1] "Exp GoF: 0.0833473687008565"
## [1] "Exp xmin: 3"
## [1] "Exp pars: 0.0614351608577561"
## [1] "Continuous delta-T Fit  auto 3 מכונות"
## [1] "P-L GoF: 0.161902307769954"
## [1] "P-L xmin: 11"
## [1] "P-L pars: 2.39"

## [1] "L-N GoF: 0.0829530783392965"
## [1] "L-n xmin: 8"
## [1] "L-N pars: 2.9932536422256"   "L-N pars: 0.689081070654129"
## [1] "Weibull GoF: 0.069202689036997"
## [1] "Weibull xmin: 3"
## [1] "Weibull pars: 0.907566204109171" "Weibull pars: 15.0356567995893" 
## [1] "Exp GoF: 0.064454227222464"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.07"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  66 
## median:  11 
## mean:  16.22222 
## estimated sd:  17.40321 
## estimated skewness:  1.786149 
## estimated kurtosis:  5.852686 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.9972488  0.1459388
## scale 16.1989685  3.3080352
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.239431  0.2152230
## sdlog   1.118332  0.1521851
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate Std. Error
## rate 0.06164384 0.01186024

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm  3-mle-exp
## Kolmogorov-Smirnov statistic    0.09292391  0.07485881 0.09397405
## Cramer-von Mises statistic      0.03349471  0.02093662 0.03414983
## Anderson-Darling statistic      0.24214060  0.17954659 0.24475701
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      208.4643    207.5912  206.4646
## Bayesian Information Criterion      211.0560    210.1829  207.7605
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.7364001     0.6446802     0.8468757 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##    0.09292391    0.07485881    0.09397405 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      208.4643      207.5912      206.4646 
## [1] "delta-T Fit  auto 3 מסגרות"
## [1] "Continuous delta-T Fit  auto 3 מסגרות"
## [1] "P-L GoF: Inf"
## [1] "P-L xmin: NA"
## [1] "P-L pars: NA"
## [1] "L-N GoF: Inf"
## [1] "L-n xmin: NA"
## [1] "L-N pars: NA" "L-N pars: NA"
## [1] "Weibull GoF: Inf"
## [1] "Weibull xmin: NA"
## [1] "Weibull pars: NA" "Weibull pars: NA"
## [1] "Exp GoF: Inf"
## [1] "Exp xmin: NA"
## [1] "Exp pars: NA"
## [1] "delta-T Fit  auto 4 בקרות"
## [1] "Discrete delta-T Fit  auto 4 בקרות"
## [1] "P-L GoF: 0.243264438288696"
## [1] "P-L xmin: 47"
## [1] "P-L pars: 2.79"

## [1] "L-N GoF: 0.228513961622153"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 2.14884850072246" "L-N pars: 2.38999345157357"
## [1] "LogNormal fit: 2.71277441573969 - -47.8772317710349"
## [2] "LogNormal fit: 1.92708833325126 - -47.8772317710349"
## [1] "Exponential fit: 0.0213219616204691 - -48.4801767545223"
## [1] "Poisson GoF: 0.421295630501746"
## [1] "Poisson xmin: 13"
## [1] "Poisson pars: 66.5714261840606"
## [1] "Exp GoF: 0.24377730356037"
## [1] "Exp xmin: 47"
## [1] "Exp pars: 0.0241100356937831"
## [1] "Continuous delta-T Fit  auto 4 בקרות"
## [1] "P-L GoF: 0.245737122190868"
## [1] "P-L xmin: 47"
## [1] "P-L pars: 2.82"

## [1] "L-N GoF: 0.206211013349486"
## [1] "L-n xmin: 13"
## [1] "L-N pars: 4.39956524993264" "L-N pars: 0.39729487812961"
## [1] "Weibull GoF: 0.204550703220795"
## [1] "Weibull xmin: 47"
## [1] "Weibull pars: 3.099069453655"   "Weibull pars: 104.550681963489"
## [1] "Exp GoF: 0.185618898573022"
## [1] "Exp xmin: 47"
## [1] "Exp pars: 0.02"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  133 
## median:  30 
## mean:  46.9 
## estimated sd:  50.42585 
## estimated skewness:  0.8107675 
## estimated kurtosis:  2.262251 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.6739197  0.1784901
## scale 37.3675408 18.4351161
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.712774  0.6093988
## sdlog   1.927088  0.4309095
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate  Std. Error
## rate 0.02132196 0.006727727

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm 3-mle-exp
## Kolmogorov-Smirnov statistic    0.21654006   0.2224727 0.2789037
## Cramer-von Mises statistic      0.08485864   0.1114363 0.1571099
## Anderson-Darling statistic      0.61752790   0.7677736 1.7124345
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      98.38850    99.75446  98.96035
## Bayesian Information Criterion      98.99367   100.35963  99.26294
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##  8.147425e-03  5.668552e-03  3.648328e-09 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.2165401     0.2224727     0.2789037 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      98.38850      99.75446      98.96035 
## [1] "delta-T Fit  auto 4 חשמל"
## [1] "Discrete delta-T Fit  auto 4 חשמל"
## [1] "P-L GoF: 0.222959295662219"
## [1] "P-L xmin: 38"
## [1] "P-L pars: 3.86"

## [1] "L-N GoF: 0.216799940394021"
## [1] "L-n xmin: 24"
## [1] "L-N pars: 3.66535040473691"  "L-N pars: 0.601634591771221"
## [1] "LogNormal fit: 2.91814492905337 - -53.1072658332406"
## [2] "LogNormal fit: 1.63370394417962 - -53.1072658332406"
## [1] "Exponential fit: 0.025 - -51.5776739952533"
## [1] "Poisson GoF: 0.334973936393568"
## [1] "Poisson xmin: 3"
## [1] "Poisson pars: 48.6666666701899"
## [1] "Exp GoF: 0.239679088056651"
## [1] "Exp xmin: 24"
## [1] "Exp pars: 0.0324017881863079"
## [1] "Continuous delta-T Fit  auto 4 חשמל"
## [1] "P-L GoF: 0.118640278552544"
## [1] "P-L xmin: 38"
## [1] "P-L pars: 3.97"

## [1] "L-N GoF: 0.176247641166408"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 3.56613619027095"  "L-N pars: 0.975171352782848"
## [1] "Weibull GoF: 0.168650515600267"
## [1] "Weibull xmin: 1"
## [1] "Weibull pars: 1.42322740988865" "Weibull pars: 53.0511160218507"
## [1] "Exp GoF: 0.204688089718713"
## [1] "Exp xmin: 40"
## [1] "Exp pars: 0.05"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  133 
## median:  40 
## mean:  40 
## estimated sd:  37.3497 
## estimated skewness:  1.510106 
## estimated kurtosis:  6.526036 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.8902756  0.2281187
## scale 38.1687566 13.5022351
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.918145  0.4925803
## sdlog   1.633704  0.3483063
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##      estimate  Std. Error
## rate    0.025 0.007525701

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm 3-mle-exp
## Kolmogorov-Smirnov statistic     0.2670329   0.3065306 0.2496226
## Cramer-von Mises statistic       0.1506007   0.2168385 0.1388812
## Anderson-Darling statistic       0.8765161   1.1637028 0.9898655
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      106.9386    110.2145  105.1553
## Bayesian Information Criterion      107.7344    111.0103  105.5532
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##  0.0022544855  0.0001518235  0.0009978613 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.2670329     0.3065306     0.2496226 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      106.9386      110.2145      105.1553 
## [1] "delta-T Fit  auto 4 מכונות"
## [1] "Discrete delta-T Fit  auto 4 מכונות"
## [1] "P-L GoF: 0.181054456574273"
## [1] "P-L xmin: 14"
## [1] "P-L pars: 2.04"

## [1] "L-N GoF: 0.130354626190854"
## [1] "L-n xmin: 4"
## [1] "L-N pars: 2.70080018473374" "L-N pars: 1.38235277930634"
## [1] "LogNormal fit: 2.63616875233787 - -62.3203666407151"
## [2] "LogNormal fit: 1.48638570897349 - -62.3203666407151"
## [1] "Exponential fit: 0.0304347826086957 - -62.8903682381504"
## [1] "Poisson GoF: 0.249999983698008"
## [1] "Poisson xmin: 41"
## [1] "Poisson pars: 86.9999993319964"
## [1] "Exp GoF: 0.198600809949927"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.0309183221814427"
## [1] "Continuous delta-T Fit  auto 4 מכונות"
## [1] "P-L GoF: 0.172184492142303"
## [1] "P-L xmin: 83"
## [1] "P-L pars: 5"

## [1] "L-N GoF: 0.143809246778374"
## [1] "L-n xmin: 28"
## [1] "L-N pars: 4.37524641273027"  "L-N pars: 0.434551692203623"
## [1] "Weibull GoF: 0.137753891706797"
## [1] "Weibull xmin: 19"
## [1] "Weibull pars: 1.87574135933686" "Weibull pars: 80.0652635818428"
## [1] "Exp GoF: 0.154176823802561"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.03"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  131 
## median:  16.5 
## mean:  32.85714 
## estimated sd:  40.43391 
## estimated skewness:  1.551634 
## estimated kurtosis:  4.48515 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.7867666  0.1644346
## scale 28.5725162 10.2546862
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 2.636169  0.3972533
## sdlog   1.486386  0.2808999
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate  Std. Error
## rate 0.03043478 0.008125245

## Goodness-of-fit statistics
##                              1-mle-weibull 2-mle-lnorm 3-mle-exp
## Kolmogorov-Smirnov statistic    0.12697878   0.1436324 0.2037301
## Cramer-von Mises statistic      0.03377359   0.0362891 0.1230758
## Anderson-Darling statistic      0.24928340   0.2896075 0.8363362
## 
## Goodness-of-fit criteria
##                                1-mle-weibull 2-mle-lnorm 3-mle-exp
## Akaike's Information Criterion      128.3087    128.6407  127.7807
## Bayesian Information Criterion      129.5868    129.9188  128.4198
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.2769190     0.2557333     0.1160080 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##     0.1269788     0.1436324     0.2037301 
## 1-mle-weibull   2-mle-lnorm     3-mle-exp 
##      128.3087      128.6407      127.7807 
## [1] "delta-T Fit  auto 4 מסגרות"
## [1] "Discrete delta-T Fit  auto 4 מסגרות"
## [1] "P-L GoF: 0.323838609713154"
## [1] "P-L xmin: 95"
## [1] "P-L pars: 5"

## [1] "L-N GoF: 0.440116418651392"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 3.33156604889"    "L-N pars: 2.29117355122976"
## [1] "LogNormal fit: 3.55458638591604 - -22.7759867301667"
## [2] "LogNormal fit: 2.05540264573749 - -22.7759867301667"
## [1] "Exponential fit: 0.0115273775216138 - -21.8521216753079"
## [1] "Poisson GoF: 0.457721914698263"
## [1] "Poisson xmin: 95"
## [1] "Poisson pars: 114.66834722792"
## [1] "Exp GoF: 0.414463380431729"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.0116172785031059"
## [1] "Continuous delta-T Fit  auto 4 מסגרות"
## [1] "P-L GoF: 0.322152027685799"
## [1] "P-L xmin: 95"
## [1] "P-L pars: 5"

## [1] "L-N GoF: 0.230488241497727"
## [1] "L-n xmin: 1"
## [1] "L-N pars: 4.73944851455472"  "L-N pars: 0.131587707306946"
## [1] "Weibull GoF: 0.219604240548948"
## [1] "Weibull xmin: 1"
## [1] "Weibull pars: 11.2949626392722" "Weibull pars: 121.390422002302"
## [1] "Exp GoF: 0.359372164641479"
## [1] "Exp xmin: 1"
## [1] "Exp pars: 0.01"
## [1] "cont fit+"
## summary statistics
## ------
## min:  1   max:  127 
## median:  109.5 
## mean:  86.75 
## estimated sd:  58.95973 
## estimated skewness:  -1.668854 
## estimated kurtosis:  5.670299 
## Fitting of the distribution ' weibull ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## shape  0.8533574   0.405735
## scale 82.7972345  50.025485
## Fitting of the distribution ' lnorm ' by maximum likelihood 
## Parameters:
##         estimate Std. Error
## meanlog 3.554586  1.0277013
## sdlog   2.055403  0.7266938
## Fitting of the distribution ' exp ' by maximum likelihood 
## Parameters:
##        estimate  Std. Error
## rate 0.01152738 0.005719927

## <simpleError in ans[!test & ok] <- rep(no, length.out = length(ans))[!test &     ok]: replacement has length zero>
## NULL
## NULL
## NULL
## NULL
close(f)