Skip to content

Commit

Permalink
version 0.2-2
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuergin authored and cran-robot committed Nov 8, 2014
1 parent 19fb979 commit 0a5b0fc
Show file tree
Hide file tree
Showing 34 changed files with 2,223 additions and 1,524 deletions.
11 changes: 6 additions & 5 deletions DESCRIPTION
Expand Up @@ -2,22 +2,23 @@ Package: vcrpart
Type: Package
Title: Tree-Based Varying Coefficient Regression for Generalized Linear
and Ordinal Mixed Models
Version: 0.2-1
Date: 2014-09-10
Version: 0.2-2
Date: 2014-10-24
Authors@R: c(
person("Reto", "Buergin", role = c("aut", "cre", "cph"), email = "rbuergin@gmx.ch"),
person("Gilbert", "Ritschard", role = c("ctb", "ths"),
email = "gilbert.ritschard@unige.ch"))
Maintainer: Reto Buergin <rbuergin@gmx.ch>
Description: Recursive partitioning algorithm for varying coefficient generalized linear models and ordinal 2-stage linear mixed models. Special features are coefficient-wise partitioning, non-varying coefficients and partitioning of time-varying variables in longitudinal ordinal regression.
Description: Recursive partitioning for varying coefficient generalized linear models and ordinal linear mixed models. Special features are coefficient-wise partitioning, non-varying coefficients and partitioning of time-varying variables in longitudinal regression.
License: GPL (>= 2)
Depends: R (>= 3.1.0), parallel, partykit
Imports: stats, grid, graphics, methods, nlme, rpart, numDeriv, ucminf,
zoo, sandwich, strucchange
URL: http://vcrpart.wordpress.com
LazyLoad: yes
NeedsCompilation: yes
Packaged: 2014-09-09 22:27:25 UTC; rbuergin
Packaged: 2014-11-07 17:28:59 UTC; reto
Author: Reto Buergin [aut, cre, cph],
Gilbert Ritschard [ctb, ths]
Repository: CRAN
Date/Publication: 2014-09-10 00:51:30
Date/Publication: 2014-11-08 02:13:19
60 changes: 33 additions & 27 deletions MD5
@@ -1,20 +1,21 @@
1cbd34b3510d90cfb1a6848b44abb82b *DESCRIPTION
9fa1ee1a037664dca6310ec341ced692 *NAMESPACE
c9cf28f3456a5cf3c5d84783d4c6f7bb *NEWS
6d24e99c18c914344785bf01d1b715a6 *DESCRIPTION
dfae833697182c8bb7f3b3572b2413e6 *NAMESPACE
4ad832a72530f1d077cd0296dbcdecb7 *NEWS
8b40e51cf24df0eb99503a7070b84a93 *R/AAA.R
76803808590893cc4202d5c78b2b8ada *R/AllGeneric.R
ed5c8359901f28c78724ea61ac731f3b *R/fvcm.R
b70bc37834d2f3b8c94d9d1c0020c614 *R/AllGeneric.R
91d50efd23854dea04fca307a8c9ce97 *R/fvcm.R
80b84163397dcda539b20d9ab51c56e7 *R/import.R
38166df78924be2eecfa73a0df50500d *R/olmm-methods.R
0801b64fedea58af67c400f8b0e15bd2 *R/olmm-methods.R
7e4d28175b9184bf3a0992401f277072 *R/olmm-utils.R
47d508ee6eda573318986badf2bc07b1 *R/olmm.R
ecdcf046dcbb466c4cf29bc7e9efaf8a *R/olmm.R
b6c73716e8ea10810b0ef419e666217c *R/otsplot.R
93374105b3b9b55f260ebe19155d9d8b *R/tvcm-cv.R
5ded623facdc6ee8b637444a5328c3d2 *R/tvcm-methods.R
535373d36b06c8ce69666be8656a398f *R/tvcm-plot.R
556205fc2616156b58239d61f6ae926f *R/tvcm-utils.R
db0d8050384fd821d8f3f31acc56b14c *R/tvcm.R
0ecd155512121e5553df3af06a0a1fc2 *R/utils.R
2af1d39305eedf8fc4128b14307e1317 *R/tvcm-cv.R
32a6d478af156ed579d5909795d5cc98 *R/tvcm-methods.R
d7de761ae5514253233d0540ddd85ec5 *R/tvcm-plot.R
3d45fc591fdde7ffc882b8add1448436 *R/tvcm-utils.R
efa265167aaa866b67a1acd78df5a859 *R/tvcm.R
759f474cb091fa4062bec1eaabfdd8de *R/utils.R
8562fccdfc9dc113b72f8eb8df66bf57 *data/PL.RData
a2c9a87cf50549fd5802cbb6a88d281a *data/movie.RData
72890e1f368da6d42d9cf9414c5396e0 *data/poverty.RData
ea62be4e5d10df5bc683725a7f7935f6 *data/schizo.RData
Expand All @@ -23,28 +24,33 @@ ea62be4e5d10df5bc683725a7f7935f6 *data/schizo.RData
cb803decf95c39567f648e1e5e0ddb45 *data/vcrpart_2.RData
3ddf5ac69dc37253946b83c5bfd5fca7 *data/vcrpart_3.RData
c2c0ec5bc767a17c65b372996eb094bc *inst/CITATION
3bc5b4abcf89156967fbf807a9125ee6 *man/PL.Rd
02a3675b72ff9f699d45dab0183780b8 *man/fvcm-methods.Rd
1bd0959c572019011ab4c537f9f86919 *man/fvcm.Rd
2ad931e91f7922156d825b32e68df10a *man/fvcm.Rd
edb080c605c0dacb43ae037d6199abd4 *man/movie.Rd
f66f99d711ddf32948fbf9b39c63b888 *man/olmm-control.Rd
b57f0746e38cad4b16bfe592ec7c60ac *man/olmm-gefp.Rd
6ee7950a48737e3b9ef60d8ba4990989 *man/olmm-methods.Rd
e7cc5a4ab52c84577dd32c4c04219ef1 *man/olmm-gefp.Rd
c0635745a839f49a8ffaa66ffcacdb65 *man/olmm-methods.Rd
e58a118afbf3ff05498f9e5bbc73e893 *man/olmm-predict.Rd
c914ee5c769aacd190558f0b967f1072 *man/olmm-summary.Rd
fedfc37145b8e3764bef8589ad05496c *man/olmm.Rd
99fd9612846185c8b253368ad62640bc *man/olmm.Rd
913e87ac8d1158061b59644190ef8984 *man/otsplot.Rd
58735e7359b9794d34d5c78eb0c07aa4 *man/poverty.Rd
b5d023f2e25d796fc013667de0bf0c2b *man/poverty.Rd
198b4f1a33689dc49700c02f14e42510 *man/schizo.Rd
061e82789901fc9517c35f3d44daa35c *man/tvcm-control.Rd
2a47a463b75faddfdbaacdd763760b9e *man/tvcm-cv.Rd
33dc39a7f1d534bbd8b26a5a89b05f1e *man/tvcm-methods.Rd
20100f8ce3bbcb0ca761531b0705dee8 *man/tvcm-plot.Rd
1676e4649643b03e5b50cf0b79988d6d *man/tvcm.Rd
830a40f120259f6c1e30cce2f06a224e *man/tvcglm.Rd
fc4d871d97b9315c31c720307d4b481c *man/tvcm-control.Rd
5b0157aea2925e83c7325814864fad14 *man/tvcm-cv.Rd
c2434053aa241bce6f70d969bf385e25 *man/tvcm-methods.Rd
0fa2459d031af80f1b4dbd7d3d1da797 *man/tvcm-plot.Rd
395961700e672d7ba7f7901564e83892 *man/tvcm.Rd
8c644871c09cae7e14ca6ad204a0dee3 *man/tvcolmm.Rd
158d7c7045232f33bd35bf5c39dcedcf *man/vcrpart-demo.Rd
a14ef1287c994bf09c716cc21d50517f *man/vcrpart-formula.Rd
1e0af65b11fb043bd18f7982291d076f *src/Makevars
490c20f360ddf1fa209c81bbf51ba1de *src/init.c
04dd4cbf292548702d5590e2475aec35 *src/olmm.c
e0ee3aca34161fb42f8fffa717fc6c3e *src/init.c
62783432fffd5da456a3bb3e61c2be35 *src/olmm.c
1e5f560c59e4ea73b51fa72c057166ec *src/olmm.h
e5dcd67c462566773294a1e5829ef188 *src/utils.c
5d30135987641736d67d08d3c140c86e *src/utils.h
0af72621bd0a3d74afc3a3a0220f92c4 *src/tvcm.c
e8b96835ed09462a3fef4b1f581279cd *src/tvcm.h
79abdf7fd5ae53f7c77a6db8453d3408 *src/utils.c
643b41eb70ee7ca5689f176f7d82b795 *src/utils.h
11 changes: 10 additions & 1 deletion NAMESPACE
Expand Up @@ -49,16 +49,23 @@ export(
predecor_control,
estfun.olmm,
gefp.olmm,
tvcm_control,
tvcm_control,
tvcolmm_control,
tvcglm_control,
tvcm,
tvcolmm,
tvcglm,
fvcm,
fvcolmm,
fvcglm,
fvcm_control,
fvcolmm_control,
fvcglm_control,
folds_control)

## Exported methods for 'glm' class
S3method(fixef, glm)

## Exported methods for 'fvcm' class
S3method(fitted, fvcm)
S3method(predict, fvcm)
Expand Down Expand Up @@ -109,6 +116,7 @@ S3method(print, otsplot)
## Exported methods for 'tvcm' class
S3method(coef, tvcm)
S3method(coefficients, tvcm)
S3method(depth, tvcm)
S3method(cvloss, tvcm)
S3method(plot, cvloss.tvcm)
S3method(print, cvloss.tvcm)
Expand All @@ -135,3 +143,4 @@ S3method(splitpath, tvcm)
S3method(print, splitpath.tvcm)
S3method(summary, tvcm)
S3method(weights, tvcm)
S3method(width, tvcm)
41 changes: 38 additions & 3 deletions NEWS
@@ -1,9 +1,44 @@
Changes in Version 0.2-2

o Added seed option to 'tvcm_control'.

o The new implementation clearly distinguishes between the two
functions 'tvcolmm' and 'tvcolmm' with separate help files.
The general function 'tvcm' is still available.

o Added convenience function 'tvcolmm_control' and
'tvglm_control'.

o Improvement for 'panel_coef': Points and lines surpassing
the boxes are now suppressed.

o Added variable centering as default for split selection.

o Redefinition of tuning parameters for 'tvcm'. The main
tuning parameter is now 'cp'. See the help of 'tvcm' and
'tvcm_control' for details.

o Added 'nimpute' argument for 'tvcm_control'.

o Added detail section to the help page of 'tvcm_control'

o Removed AIC table from 'print.tvcm' (AIC and BIC seem not
relevant measures for models fitted by 'tvcm').

o Added 'PL' data set.

o Removed bug for numeric estimation of covariance of 'olmm'
objects.

o Added 'depth' and 'width' methods.


Changes in Version 0.2-1

o First CRAN release.
o First CRAN release.

o 'tvcm' and 'fvcm' allow for multiple 'vc' terms, i.e.
coefficient-specific partitions
o 'tvcm' and 'fvcm' allow for multiple 'vc' terms, i.e.
coefficient-specific partitions

o Complete revision of syntaxes, argument names and default
parameters. R commands for the former version 0.1-14 are
Expand Down
2 changes: 2 additions & 0 deletions R/AllGeneric.R
Expand Up @@ -35,6 +35,8 @@ cvloss <- function(object, ...) UseMethod("cvloss")

extract <- function(object, ...) UseMethod("extract")

fixef.glm <- function(object, ...) coef(object)

neglogLik2 <- function(object, ...) UseMethod("neglogLik2")

neglogLik2.default <- function(object, ...)
Expand Down
37 changes: 31 additions & 6 deletions R/fvcm.R
@@ -1,7 +1,7 @@
##' -------------------------------------------------------- #
##' Author: Reto Buergin
##' E-Mail: reto.buergin@unige.ch, rbuergin@gmx.ch
##' Date: 2014-09-07
##' Date: 2014-10-14
##'
##' Description:
##' Random forests and bagging for the 'tvcm' algorithm.
Expand All @@ -22,6 +22,9 @@
##' - set 'ptry', 'vtry' and 'ntry' automatically (see Hastie)
##'
##' Last modifications:
##' 2014-10-14: found bug in predict.tvcm: now the 'coefi'
##' matrices are ordered by the column names of
##' 'coef'.
##' 2014-09-07: - improvment of predict.tvcm function
##' - treated bugs for 'type = "coef"'
##' - deal with ordinal responses in cases not
Expand All @@ -33,7 +36,7 @@
##' 2014-08-05: - changed specification for folds
##' -------------------------------------------------------- #

fvcolmm <- function(..., family = cumulative(), control = fvcm_control()) {
fvcolmm <- function(..., family = cumulative(), control = fvcolmm_control()) {
mc <- match.call()
mc[[1L]] <- as.name("fvcm")
mc$fit <- "olmm"
Expand All @@ -43,7 +46,17 @@ fvcolmm <- function(..., family = cumulative(), control = fvcm_control()) {
}


fvcglm <- function(..., family, control = fvcm_control()) {
fvcolmm_control <- function(maxstep = 10, folds = folds_control("subsampling", 5),
ptry = 1, ntry = 1, vtry = 5, alpha = 1.0, ...) {

mc <- match.call()
mc[[1L]] <- as.name("fvcm_control")
mc$sctest <- TRUE
return(eval.parent(mc))
}


fvcglm <- function(..., family, control = fvcglm_control()) {
mc <- match.call()
mc[[1L]] <- as.name("fvcm")
mc$fit <- "glm"
Expand All @@ -53,6 +66,15 @@ fvcglm <- function(..., family, control = fvcm_control()) {
}


fvcglm_control <- function(maxstep = 10, folds = folds_control("subsampling", 5),
ptry = 1, ntry = 1, vtry = 5, mindev = 0, ...) {

mc <- match.call()
mc[[1L]] <- as.name("fvcm_control")
return(eval.parent(mc))
}


fvcm <- function(..., control = fvcm_control()) {

mc <- match.call()
Expand Down Expand Up @@ -110,7 +132,7 @@ fvcm <- function(..., control = fvcm_control()) {

fvcm_control <- function(maxstep = 10, folds = folds_control("subsampling", 5),
ptry = 1, ntry = 1, vtry = 5,
alpha = 1.0, maxoverstep = Inf, ...) {
alpha = 1.0, mindev = 0.0, ...) {

## modify the 'papply' argument
mc <- match.call()
Expand All @@ -123,7 +145,7 @@ fvcm_control <- function(maxstep = 10, folds = folds_control("subsampling", 5),
## combine the parameter to a list and disble cross validation and pruning
call <- list(maxstep = maxstep, folds = folds,
ptry = ptry, ntry = ntry, vtry = vtry,
alpha = alpha, maxoverstep = Inf,
alpha = alpha, mindev = mindev,
papply = papply, cv = FALSE, prune = FALSE)
call <- appendDefArgs(call, list(...))

Expand Down Expand Up @@ -346,7 +368,7 @@ predict.fvcm <- function(object, newdata = NULL,
coefi <- predict(object, newdata = newdata, type = "coef",
ranef = FALSE, na.action = na.pass, ...)
if (!is.matrix(coefi)) coefi <- matrix(coefi, nrow = nrow(newdata))

## acount for skipped categories
if (object$info$fit == "olmm" && ncol(coefi) < ncol(coef)) {
subsiCols <- table(mf[folds[, i] > 0, yName]) > 0L
Expand All @@ -366,6 +388,9 @@ predict.fvcm <- function(object, newdata = NULL,
colnames(coefi) <- colnamesi
}

## order columns of coefi
coefi <- coefi[, intersect(colnames(coef), colnames(coefi)), drop = FALSE]

## index matrix for valid entries
subsi <- subs
if (oob) subsi[folds[,i] > 0L, ] <- FALSE
Expand Down

0 comments on commit 0a5b0fc

Please sign in to comment.