Learn R Programming

AMIAS (version 1.1.0)

print.amias: Print an amias or a samias object

Description

Print a summary of the fitted "amias" or "samias" object.

Usage

# S3 method for amias
print(x, ...)
# S3 method for samias
print(x, digits = max(3, getOption("digits") - 3), ...)

Arguments

x

A list with class attribute 'amias' or 'samias'.

digits

significant digits in printout

Additional print arguments.

Value

A summary or a three-column matrix is silently returned.

Details

For an "amias" object, the call that produced the object x is printed, followed by a summary of the output.

For a "samias" object, the call that produced the object x is printed, followed by a three-column matrix with columns k, Df and %BIC. The k column is the number of knots and the Df column is the degree of freedom defined as \(Df = k+q+1\). BIC is the BIC value.

References

Wen, C., Zhu, J., Wang, X., and Zhang, A. (2018) L0 trend filtering, technique report.

See Also

amias, samias.

Examples

Run this code
# NOT RUN {
  ##----- A toy example -------
  set.seed(0)
  n <- 100
  x = seq(1/n, 1,length.out = n)
  y0 = 0*x; y0[x>0.5] = 1
  y = y0 + rnorm(n, sd = 0.1)
  
  # For 'amias' object
  fit <- amias(y, k = 1) 
  print(fit)
  
  # For 'samias' object
  fit <- samias(y, kmax = 5)
  print(fit)
  
# }

Run the code above in your browser using DataLab