R Under development (unstable) (2024-02-23 r85978 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > suppressMessages(library(cobs)) > options(digits = 6, warn = 2) ## << all warnings to errors! > > ## When 'R CMD check'ing, we may want to see exact package information: > sessionInfo() # plus the details of the major dependent packages: R Under development (unstable) (2024-02-23 r85978 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] cobs_1.3-8 loaded via a namespace (and not attached): [1] MASS_7.3-60.2 compiler_4.4.0 Matrix_1.6-5 quantreg_5.97 [5] SparseM_1.81 survival_3.5-8 MatrixModels_0.5-3 splines_4.4.0 [9] grid_4.4.0 lattice_0.22-5 > packageDescription("SparseM") Package: SparseM Version: 1.81 Authors@R: c( person("Roger", "Koenker", role = c("cre","aut"), email = "rkoenker@uiuc.edu"), person(c("Pin", "Tian"), "Ng", role = c("ctb"), comment = "Contributions to Sparse QR code", email = "pin.ng@nau.edu"), person("Yousef", "Saad", role = c("ctb"), comment = "author of sparskit2"), person("Ben", "Shaby", role = c("ctb"), comment = "author of chol2csr")) Maintainer: Roger Koenker Depends: R (>= 2.15), methods Imports: graphics, stats, utils Author: Roger Koenker [cre, aut], Pin Tian Ng [ctb] (Contributions to Sparse QR code), Yousef Saad [ctb] (author of sparskit2), Ben Shaby [ctb] (author of chol2csr) Description: Some basic linear algebra functionality for sparse matrices is provided: including Cholesky decomposition and backsolving as well as standard R subsetting and Kronecker products. License: GPL (>= 2) Title: Sparse Linear Algebra URL: http://www.econ.uiuc.edu/~roger/research/sparse/sparse.html NeedsCompilation: yes Repository: CRAN Packaged: 2021-02-18 11:10:52 UTC; roger Date/Publication: 2021-02-18 12:00:02 UTC Built: R 4.4.0; x86_64-w64-mingw32; 2024-02-10 01:33:22 UTC; windows Archs: x64 -- File: D:/RCompile/CRANpkg/lib/4.4/SparseM/Meta/package.rds > packageDescription("quantreg") Package: quantreg Title: Quantile Regression Description: Estimation and inference methods for models for conditional quantile functions: Linear and nonlinear parametric and non-parametric (total variation penalized) models for conditional quantiles of a univariate response and several methods for handling censored survival data. Portfolio selection methods based on expected shortfall risk are also now included. See Koenker, R. (2005) Quantile Regression, Cambridge U. Press, and Koenker, R. et al. (2017) Handbook of Quantile Regression, CRC Press, . Version: 5.97 Authors@R: c( person("Roger", "Koenker", role = c("cre","aut"), email = "rkoenker@illinois.edu"), person("Stephen", "Portnoy", role = c("ctb"), comment = "Contributions to Censored QR code", email = "sportnoy@illinois.edu"), person(c("Pin", "Tian"), "Ng", role = c("ctb"), comment = "Contributions to Sparse QR code", email = "pin.ng@nau.edu"), person("Blaise", "Melly", role = c("ctb"), comment = "Contributions to preprocessing code", email = "mellyblaise@gmail.com"), person("Achim", "Zeileis", role = c("ctb"), comment = "Contributions to dynrq code essentially identical to his dynlm code", email = "Achim.Zeileis@uibk.ac.at"), person("Philip", "Grosjean", role = c("ctb"), comment = "Contributions to nlrq code", email = "phgrosjean@sciviews.org"), person("Cleve", "Moler", role = c("ctb"), comment = "author of several linpack routines"), person("Yousef", "Saad", role = c("ctb"), comment = "author of sparskit2"), person("Victor", "Chernozhukov", role = c("ctb"), comment = "contributions to extreme value inference code"), person("Ivan", "Fernandez-Val", role = c("ctb"), comment = "contributions to extreme value inference code"), person(c("Brian", "D"), "Ripley", role = c("trl","ctb"), comment = "Initial (2001) R port from S (to my everlasting shame -- how could I have been so slow to adopt R!) and for numerous other suggestions and useful advice", email = "ripley@stats.ox.ac.uk")) Maintainer: Roger Koenker Repository: CRAN Depends: R (>= 3.5), stats, SparseM Imports: methods, graphics, Matrix, MatrixModels, survival, MASS Suggests: interp, rgl, logspline, nor1mix, Formula, zoo, R.rsp, conquer License: GPL (>= 2) URL: https://www.r-project.org NeedsCompilation: yes VignetteBuilder: R.rsp Packaged: 2023-08-19 12:48:42 UTC; roger Author: Roger Koenker [cre, aut], Stephen Portnoy [ctb] (Contributions to Censored QR code), Pin Tian Ng [ctb] (Contributions to Sparse QR code), Blaise Melly [ctb] (Contributions to preprocessing code), Achim Zeileis [ctb] (Contributions to dynrq code essentially identical to his dynlm code), Philip Grosjean [ctb] (Contributions to nlrq code), Cleve Moler [ctb] (author of several linpack routines), Yousef Saad [ctb] (author of sparskit2), Victor Chernozhukov [ctb] (contributions to extreme value inference code), Ivan Fernandez-Val [ctb] (contributions to extreme value inference code), Brian D Ripley [trl, ctb] (Initial (2001) R port from S (to my everlasting shame -- how could I have been so slow to adopt R!) and for numerous other suggestions and useful advice) Date/Publication: 2023-08-19 13:50:05 UTC Built: R 4.4.0; x86_64-w64-mingw32; 2024-02-19 02:36:48 UTC; windows Archs: x64 -- File: D:/RCompile/CRANpkg/lib/4.4/quantreg/Meta/package.rds > packageDescription("cobs") Package: cobs Version: 1.3-8 VersionNote: Released 1.3-7 on 2024-02-03 Date: 2024-02-25 Title: Constrained B-Splines (Sparse Matrix Based) Description: Qualitatively Constrained (Regression) Smoothing Splines via Linear Programming and Sparse Matrices. Author: Pin T. Ng and Martin Maechler Maintainer: Martin Maechler Imports: SparseM (>= 1.6), quantreg (>= 4.65), grDevices, graphics, splines, stats, methods Suggests: Matrix LazyData: yes BuildResaveData: no URL: https://curves-etc.r-forge.r-project.org/, https://r-forge.r-project.org/R/?group_id=846, https://r-forge.r-project.org/scm/viewvc.php/pkg/cobs/?root=curves-etc, https://www2.nau.edu/PinNg/cobs.html, svn://svn.r-forge.r-project.org/svnroot/curves-etc/pkg/cobs BugReports: https://r-forge.r-project.org/R/?group_id=846 License: GPL (>= 2) NeedsCompilation: yes Packaged: 2024-02-24 18:31:02 UTC; maechler Built: R 4.4.0; x86_64-w64-mingw32; 2024-02-24 19:50:05 UTC; windows Archs: x64 -- File: D:/RCompile/CRANincoming/R-devel/lib/cobs/Meta/package.rds > ## > > str(.M <- .Machine, digits = 8) List of 29 $ double.eps : num 2.220446e-16 $ double.neg.eps : num 1.110223e-16 $ double.xmin : num 2.2250739e-308 $ double.xmax : num 1.7976931e+308 $ double.base : int 2 $ double.digits : int 53 $ double.rounding : int 5 $ double.guard : int 0 $ double.ulp.digits : int -52 $ double.neg.ulp.digits : int -53 $ double.exponent : int 11 $ double.min.exp : int -1022 $ double.max.exp : int 1024 $ integer.max : int 2147483647 $ sizeof.long : int 4 $ sizeof.longlong : int 8 $ sizeof.longdouble : int 16 $ sizeof.pointer : int 8 $ sizeof.time_t : int 8 $ longdouble.eps : num 1.0842022e-19 $ longdouble.neg.eps : num 5.4210109e-20 $ longdouble.digits : int 64 $ longdouble.rounding : int 5 $ longdouble.guard : int 0 $ longdouble.ulp.digits : int -63 $ longdouble.neg.ulp.digits: int -64 $ longdouble.exponent : int 15 $ longdouble.min.exp : int -16382 $ longdouble.max.exp : int 16384 > capabilities() jpeg png tiff tcltk X11 aqua TRUE TRUE TRUE TRUE FALSE FALSE http/ftp sockets libxml fifo cledit iconv TRUE TRUE FALSE TRUE FALSE TRUE NLS Rprof profmem cairo ICU long.double TRUE TRUE TRUE TRUE TRUE TRUE libcurl TRUE > str(.M[grep("^sizeof", names(.M))]) ## also differentiate long-double.. List of 5 $ sizeof.long : int 4 $ sizeof.longlong : int 8 $ sizeof.longdouble: int 16 $ sizeof.pointer : int 8 $ sizeof.time_t : int 8 > (b64 <- .M$sizeof.pointer == 8) [1] TRUE > (arch <- Sys.info()[["machine"]]) [1] "x86-64" > (onWindows <- .Platform$OS.type == "windows") [1] TRUE > (win32 <- onWindows && !b64) [1] FALSE > > op <- options(warn = 2) ## << all warnings to errors! > > set.seed(101) > x <- seq(-2,2, length = 100) > y <- x^2 + 0.5*rnorm(100) > ## Constraints -- choosing ones that are true for f(x) = x^2 > PW <- rbind( + c(0, -3,9), # f(-3) = 9 + c(0, 3,9), # f(3 ) = 9 + c(2, 0,0)) # f'(0) = 0 > > mod <- cobs (x,y,constraint = "convex", pointwise = PW) qbsks2(): Performing general knot selection ... Deleting unnecessary knots ... > mod COBS regression spline (degree = 2) from call: cobs(x = x, y = y, constraint = "convex", pointwise = PW) {tau=0.5}-quantile; dimensionality of fit: 3 from {3} x$knots[1:2]: -2, 2 > stopifnot(all.equal(predict(mod, c(-3, 3))[,"fit"], c(9,9), tol = 1e-12)) > > ## derivative 0 at 0 -- we miss a 'deriv = 1' argument [-> see ../TODO] > eps <- 1e-6 > stopifnot(abs(diff(predict(mod, c(-eps, eps))[,"fit"])/(2*eps)) < .001 * eps) > > proc.time() user system elapsed 1.71 0.07 1.79