R/model.description.R

Defines functions model.description

model.description <- function(model){
# builds the description of the model to be printed
# only used internally.

  key <- switch(model$key,
                hn   = "Half-normal",
                hr   = "Hazard-rate",
                unif = "Uniform",
                th1  = "Threshold 1",
                th2  = "Threshold 2",
                tpn  = "Two-part normal")

  mod.str <- paste(key, "key function")
  if(!is.null(model$adjustment)){
    adj.series <- switch(model$adjustment$series,
                         cos="cosine",
                         herm="Hermite polynomial",
                         poly="simple polynomial")
    mod.str <- paste(mod.str, "with", adj.series, "adjustment term")

    adj.order <- model$adjustment$order
    if(length(adj.order)>1){
      mod.str <- paste(mod.str, "s", sep="")
    }
    mod.str <- paste(mod.str, "of order", paste(adj.order, collapse=", "))
  }

  return(mod.str)
}

Try the mrds package in your browser

Any scripts or data that you put into this service are public.

mrds documentation built on May 29, 2024, 3:56 a.m.