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)
}
DistanceDevelopment/mrds documentation built on Feb. 15, 2024, 9:25 a.m.