* using log directory 'd:/Rcompile/CRANpkg/local/2.14/gamlss.add.Rcheck' * using R version 2.14.2 (2012-02-29) * using platform: i386-pc-mingw32 (32-bit) * using session charset: ISO8859-1 * checking for file 'gamlss.add/DESCRIPTION' ... OK * this is package 'gamlss.add' version '4.2-0' * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking whether package 'gamlss.add' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking for portable file names ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking for unstated dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... ERROR Running examples in 'gamlss.add-Ex.R' failed The error most likely occurred in: > ### Name: fk > ### Title: A function to fit break points within GAMLSS > ### Aliases: fk fk.control > ### Keywords: regression > > ### ** Examples > > # creating a linear + linear function > x <- seq(0,10, length.out=201) > knot <- 5 > set.seed(12543) > mu <- ifelse(x<=knot,5+0.5*x,5+0.5*x+(x-knot)) > y <- rNO(201, mu=mu, sigma=.5) > # plot the data > plot(y~x, xlim=c(-1,13), ylim=c(3,17)) > # fit model using curfit > m1 <- fitFreeKnots(x, y, knots=4, degree=1) > # fitted values > lines(fitted(m1)~x, col="red", lwd="3") > # predict > pm1<-predict(m1, newdata=-1:12) > points(-1:12,pm1, col="red",pch = 21, bg="blue") > #------------------------------------------------ > # now gamlss > #------------------------------------------------ > # get the fk function > # fit model > g0 <- gamlss(y~fk(x, degree=1, start=c(4))) knot 5.017862 knot 5.017862 knot 5.017862 GAMLSS-RS iteration 1: Global Deviance = 272.8348 knot 5.017862 GAMLSS-RS iteration 2: Global Deviance = 272.8348 > # creating data frame > da <- data.frame(y,x) > g1 <- gamlss(y~fk(x, degree=1, start=c(4)), data=da) knot 5.017862 knot 5.017862 knot 5.017862 GAMLSS-RS iteration 1: Global Deviance = 272.8348 knot 5.017862 GAMLSS-RS iteration 2: Global Deviance = 272.8348 > nd<-data.frame(x=-1:12) > pg1<-predict(g1, newdata=nd) new prediction knot 5.017862 > plot(y~x, xlim=c(-1,13), ylim=c(3,17)) > lines(fitted(g1)~x, col="purple", lwd="3") > points(pg1~I(-1:12), col="darkgreen", pch = 21, bg="green" ) > #------------------------------------------------- > #------------------------------------------------- > # now negative binomial data > eta1 <- ifelse(x<=knot,5+0.5*x,5+0.5*x+(x-knot)) > set.seed(143) > y <- rNBI(201, mu=exp(eta1/7), sigma=.1) > da <- data.frame(y=y,x=x) > #rm(y,x) > plot(y~x, data=da) > # fitting the model in gamlss using profile deviance > n1 <- quote(gamlss(y ~ x+I((x>this)*(x-this)),family=NBI,data=da)) > prof.term(n1, min=1, max=9, criterion="GD") Error in prof.term(n1, min = 1, max = 9, criterion = "GD") : you have not defined the step Execution halted