Skip to content

Commit

Permalink
Merge e64737d into 2321180
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-thomas committed Aug 25, 2016
2 parents 2321180 + e64737d commit a2086c5
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ mstop.mboostLSS <- function(object, parameter = names(object), ...){
names(RET) <- names(object)[parameter]
if (length(RET) == 1)
RET <- RET[[1]]
# change mstop for noncyclical fitting to scalar value with attribute of partitions
if (inherits(object, "nc_mboostLSS")) {
partitions = RET
RET = sum(RET)
attr(RET, "partitions") <- partitions
}

return(RET)
}

Expand Down Expand Up @@ -273,8 +280,11 @@ print.mboostLSS <- function(x, ...){
cat("\n")
if (!is.null(attr(x, "call")))
cat("Call:\n", deparse(attr(x, "call")), "\n\n", sep = "")
m = mstop(x)
if (inherits(x, "nc_mboostLSS"))
m = attr(m, "partitions")
cat("Number of boosting iterations (mstop): ",
paste(names(mstop(x)), mstop(x), sep = " = ", collapse = ", "), "\n")
paste(names(x), m, sep = " = ", collapse = ", "), "\n")
nus <- sapply(x, function(xi) xi$control$nu)
cat("Step size: ",
paste(names(nus), nus, sep = " = ", collapse = ", "), "\n\n")
Expand Down Expand Up @@ -328,10 +338,11 @@ summary.mboostLSS <- function(object, ...) {
cat("\n")
if (!is.null(attr(object, "call")))
cat("Call:\n", deparse(attr(object, "call")), "\n\n", sep = "")
m = mstop(object)
if (inherits(object, "nc_mboostLSS"))
m = attr(m, "partitions")
cat("Number of boosting iterations (mstop): ",
paste(names(mstop(object)), mstop(object),
sep = " = ", collapse = ", "),
"\n")
paste(names(object), m, sep = " = ", collapse = ", "), "\n")
nus <- sapply(object, function(xi) xi$control$nu)
cat("Step size: ",
paste(names(nus), nus, sep = " = ", collapse = ", "), "\n\n")
Expand Down

0 comments on commit a2086c5

Please sign in to comment.