Running ‘tests-nlgamlss.R’ [4s/5s]
Running the tests in ‘tests/tests-nlgamlss.R’ failed.
Complete output:
  > #------------------------------------------------------------------------------------------
  > # bring the lange data
  > #
  > library(gamlss.nl)
  Loading required package: gamlss
  Loading required package: splines
  Loading required package: gamlss.data
  Loading required package: gamlss.dist
  Loading required package: MASS
  Loading required package: nlme
  Loading required package: parallel
   **********   GAMLSS Version 5.1-2  ********** 
  For more on GAMLSS look at http://www.gamlss.org/
  Type gamlssNews() to see new features/changes/bug fixes.
  
  Loading required package: survival
  > # bring the lange data
  > data(la) 
  > plot(PET60~bflow,data=la)
  > 
  > #source("C:/GAMLSS/New Functions/logNO.R")
  > 
  > #----------------------------------------------------------------------------------------
  > # fiiting the log Normal 
  > 
  > modLOGNO<- nlgamlss(y=PET60, mu.fo=~log(bflow)+log(1-(1-exp(p1))*exp(-p2/bflow)), 
  +                sigma.formula=~1, mu.start = c(-.99, 110), sigma.start= -2, 
  +                family=LOGNO, data=la)
  Warning message:
  In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  > if(abs(deviance(modLOGNO)-2293.9) > 0.1) stop("error in nl gamlss log-NO")
  > #-----------------------------------
  > # fitting the Normal 
  > #with original parameterization
  > modNO<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-p1*exp(-p2/bflow)), sigma.formula=~1, 
  +                   mu.start = c(.6, 90), sigma.start= 3, data=la) 
  > if(abs(deviance(modNO)-2278.7) > 0.1) stop("error in nl gamlss NO")
  > # with different parameterizaion
  > modNO1<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-(1-exp(p1))*exp(-p2/bflow)), 
  +                sigma.formula=~1, mu.start = c(-.9, 90), sigma.start= 3, data=la) 
  > if(abs(deviance(modNO1)-2278.68) > 0.1) stop("error in nl gamlss NO")
  > # as an example of using function
  > funnl<- function(p)  bflow*(1-p[1]*exp(-p[2]/bflow))
  > modNO2<- nlgamlss(y=PET60, mu.fo= funnl, sigma.formula=~1, 
  +                   mu.start = c(.6, 90), sigma.start= 3, data=la)
  > if(abs(deviance(modNO2)-2278.68) > 0.1) stop("error in nl gamlss NO") 
  > #-----------------------------------
  > # fitting the Gumbel
  > modGU<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-p1*exp(-p2/bflow)), sigma.formula=~1, 
  +                     mu.start = c(.6, 110), sigma.start= 3, family=GU, data=la) 
  > if(abs(deviance(modGU)-2382.9) > 0.1) stop("error in nl gamlss GU")
  > modGU1<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-(1-exp(p1))*exp(-p2/bflow)), 
  +          sigma.formula=~1, mu.start = c(-.6, 90), sigma.start= 3, family=GU, data=la) 
  > if(abs(deviance(modGU1)-2382.9) > 0.1) stop("error in nl gamlss GU")
  > #-----------------------------------
  > # fitting the reverse Gumber
  > modRG<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-p1*exp(-p2/bflow)), sigma.formula=~1, 
  +                  mu.start = c(.6, 110), sigma.start= 3, family=RG, data=la) 
  > if(abs(deviance(modRG)-2249.82) > 0.1) stop("error in nl gamlss RG")
  > #-----------------------------------
  > # fitting Gamma
  > modGA<- nlgamlss(y=PET60,  mu.fo= ~log(bflow)+log(1-(1-exp(p1))*exp(-p2/bflow)), 
  +        sigma.formula=~1, mu.start = c(-.99, 90),, sigma.start= -.5, family=GA, data=la) 
  Warning messages:
  1: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  2: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  > if(abs(deviance(modGA)-2299.87) > 0.1) stop("error in nl gamlss GA")
  > #-----------------------------------
  > # fitting Inverse Gaussian
  > modIG<- nlgamlss(y=PET60,  mu.fo= ~log(bflow)+log(1-(1-exp(p1))*exp(-p2/bflow)), 
  +        sigma.formula=~1, mu.start = c(-.99, 90),, sigma.start= -.5, family=IG, data=la) 
  Warning messages:
  1: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  2: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  3: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  > if(abs(deviance(modIG)-2408.33) > 0.1) stop("error in nl gamlss IG")
  > #-----------------------------------
  > # getting the AIC
  > AIC(modLOGNO,modNO, modGU, modRG, modGA, modIG, k=0)
           df      AIC
  modRG     3 2249.818
  modNO     3 2278.682
  modLOGNO  3 2293.899
  modGA     3 2299.873
  modGU     3 2382.901
  modIG     3 2408.328
  > #----------------------------------------------------------------------------------------
  > # three  parameters distributions
  > modTF<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-p1*exp(-p2/bflow)), sigma.formula=~1, nu.fo=~1, 
  +              mu.start = c(.6, 110), sigma.start= 3, nu.start=2.5 ,family=TF,  data=la) 
  > if(abs(deviance(modTF)-2273.5) > 0.1) stop("error in nl gamlss TF")
  > #-----------------------------------
  > modPE<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-p1*exp(-p2/bflow)), sigma.formula=~1, 
  + nu.fo=~1, mu.start = c(.6, 110), sigma.start= 3, nu.start=0.6 ,family=PE, data=la) 
  Warning message:
  In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  > if(abs(deviance(modPE)-2275.89) > 0.1) stop("error in nl gamlss PE")
  > #-----------------------------------
  > modBCCG<- nlgamlss(y=PET60, mu.fo=~bflow*(1-(1-exp(p1))*exp(-p2/bflow)),sigma.formula=~1, 
  + nu.fo=~1, mu.start = c(-.9, 90), sigma.start= -2.3, nu.start=0, family=BCCG, data=la) 
  Warning messages:
  1: In nlgamlss(y = PET60, mu.fo = ~bflow * (1 - (1 - exp(p1)) * exp(-p2/bflow)),  :
    the value of typsize supplied is zero or negative the default value of abs(p0) was used instead
  2: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  > if(abs(deviance(modBCCG)- 2293.74) > 0.1) stop("error in nl gamlss BCCG")
  > AIC(modTF,modPE, modBCCG,k=0)
          df      AIC
  modTF    4 2273.486
  modPE    4 2275.889
  modBCCG  4 2293.739
  > #----------------------------------------------------------------------------------------
  > #  four parameters
  > # SEP
  > modSEP<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-p1*exp(-p2/bflow)), sigma.formula=~1, 
  + nu.fo=~1, mu.start = c(.6, 110), sigma.start= 3, nu.start=1, tau.start=0.6, 
  + family=SEP, data=la) 
  Warning messages:
  1: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  2: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  > if(abs(deviance(modSEP)-2273.75) > 0.1) stop("error in nl gamlss SEP")
  > #------------------------------------
  > # the BCT 
  > modBCT<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-(1-exp(p1))*exp(-p2/bflow)), sigma.formula=~1,
  +   nu.fo=~1, mu.start=c(-.9, 90), sigma.start= -2.3, nu.start=0, tau.start=log(2.5),  
  +   family=BCT, data=la, control=NL.control(hessian=FALSE))  
  Warning message:
  In nlgamlss(y = PET60, mu.fo = ~bflow * (1 - (1 - exp(p1)) * exp(-p2/bflow)),  :
    the value of typsize supplied is zero or negative the default value of abs(p0) was used instead
  > if((deviance(modBCT)-2293.74) > 0.1) stop("error in nl gamlss BCT")
  > #------------------------------------
  > # BCPE
  > modBCPE<- nlgamlss(y=PET60, mu.fo=~bflow*(1-(1-exp(p1))*exp(-p2/bflow)),sigma.formula=~1, 
  +            mu.start = c(-.9, 90), sigma.start= -2.3, nu.start=0, tau.start=log(2.5),  
  +            family=BCPE, data=la)
  Warning messages:
  1: In nlgamlss(y = PET60, mu.fo = ~bflow * (1 - (1 - exp(p1)) * exp(-p2/bflow)),  :
    the value of typsize supplied is zero or negative the default value of abs(p0) was used instead
  2: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  3: In nlm(optFunction, p = p0, hessian = hessian, fscale = fscale,  :
    NA/Inf replaced by maximum positive value
  > if((deviance(modBCPE)- 2292.81) > 0.1) stop("error in nl gamlss BCPE")
  > #------------------------------------
  > # ST3
  > #source("C:/GAMLSS/Distributions_26_11_04/Continuous/ST3/ST3.R")
  > #modST3<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-p1*exp(-p2/bflow)), sigma.formula=~1, 
  > #nu.fo=~1, mu.start = c(.6, 110), sigma.start= 3, nu.start=1, tau.start=0.6, 
  > #family=ST3, data=la) 
  > #if(abs(deviance(modST3)-2266.67) > 0.1) stop("error in nl gamlss ST3")
  > #------------------------------------
  > # JSU
  > modJSU<- nlgamlss(y=PET60, mu.fo= ~bflow*(1-p1*exp(-p2/bflow)), sigma.formula=~1, 
  + nu.fo=~1, mu.start = c(.6, 110), sigma.start= 3, nu.start=1, tau.start=0.6, 
  + family=JSU, data=la) 
  Error in cov2cor(cov) : 'V' is not a square numeric matrix
  Calls: nlgamlss -> cov2cor
  Execution halted