Bernstein Polynomial Based Semiparametric Survival Analysis
Overview
Semiparametric survival analysis based on Bernstein polynomials. 'spsurv' includes proportional hazards, proportional odds and accelerated failure time frameworks for right-censored data. RV Panaro (2020) doi:10.48550/arXiv.2003.10548.
- **CRAN resubmission:** Maintainer contact updated to
rvpanaro@gmail.com; license isGPL-3(removed the bundledLICENSEcopy of the GPL);Authors@Rroles reviewed (single maintainer; thesis advisors listed asths, withrevfor code review feedback); packageDescriptioncitation updated to<doi:10.48550/arXiv.2003.10548>; setConfig/rstantools/auto_config: FALSEand ship committed Stan C++ exports (no install-timeconfigure/rstan_config(), avoiding Windows R-develrstan.dllload failures); addedRcppParalleland syncedsrc/Makevars.winTBB flags with UnixMakevars; restoredcovr,rsample, andrsurvinSuggestsfor optional tests referenced intests/. - **Inference robustness:**
.spbp_gamma_information_diagnostics()no longer callsqr()on non-finite gamma information matrices;vcov()/survfit()return NA uncertainty with a warning when that block is unavailable.
Show all changes in 1.1.0Hide the rest of the changes in 1.1.0
- **tidymodels:** parsnip engines
spsurv(MLE) andspsurv_bayesforproportional_hazards(), newproportional_odds(), andsurvival_reg();bp_survival_reg()convenience constructor;workflow/predict(type = "survival")support. - **tidybayes:**
as_draws_df.spbp(),spread_surv_draws.spbp(), and S3 hooks fortidy_draws/spread_draws/gather_drawson Bayes fits; posterior draw indices (.chain,.iteration,.draw). - **Prediction:** censored-style
predict.spbp()types (survival,time,linear_pred);augment.spbp(). - **Vignette:**
vignette("tidymodels"). - **Inference:**
vcov.spbp()no longer applies a diagonal ridge (polishremoved); beta standard errors are unchanged when the Bernstein block is stable and no longer inflated when it is ill-conditioned. - **Summary:**
summary.spbp()now includes acoef_intervalcomponent (Wald for MLE, HPD for Bayes) and prints it whenshow_intervals = TRUE. - **Repository:** paper workflow moved from
inst/topaper/(excluded from the package tarball). - **Dependencies:** trimmed
Suggeststo packages used in vignettes, tests, or optional integrations.devtoolsandroxygen2are not listed inSuggests.
From NEWS.md in the release
Install
Health
ERRORtestsr-oldrel-macos-x86_64, r-oldrel-windows-x86_64, r-release-macos-x86_64
r-oldrel-macos-x86_64
Running ‘testthat.R’ [33s/94s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(parsnip)
> library(generics)
Attaching package: 'generics'
The following objects are masked from 'package:base':
as.difftime, as.factor, as.ordered, intersect, is.element, setdiff,
setequal, union
> library(spsurv)
Loading required package: survival
Loading required package: coda
> veteran <- survival::veteran
>
> test_check("spsurv")
SAMPLING FOR MODEL 'spbp' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 9e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.9 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: WARNING: No variance estimation is
Chain 1: performed for num_warmup < 20
Chain 1:
Chain 1: Iteration: 1 / 10 [ 10%] (Warmup)
Chain 1: Iteration: 2 / 10 [ 20%] (Warmup)
Chain 1: Iterati
...[truncated]...
. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
9. ├─stats::vcov(fit, bp.param = TRUE)
10. └─spsurv:::vcov.spbp(fit, bp.param = TRUE)
11. └─spsurv:::.spbp_sym_inv(Schur_A)
── Error ('test-vcov.R:166:3'): ill-conditioned gamma warning appears only for survfit, not after fit ──
Error: symmetric inverse requires a finite numeric matrix
Backtrace:
▆
1. ├─testthat::expect_silent(vcov(fit)) at test-vcov.R:166:3
2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
3. │ ├─testthat (local) .capture(...)
4. │ │ ├─withr::with_output_sink(...)
5. │ │ │ └─base::force(code)
6. │ │ ├─base::withCallingHandlers(...)
7. │ │ └─base::withVisible(code)
8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
9. ├─stats::vcov(fit)
10. └─spsurv:::vcov.spbp(fit)
11. └─spsurv:::.spbp_sym_inv(Schur_A)
[ FAIL 3 | WARN 46 | SKIP 1 | PASS 672 ]
Error:
! Test failures.
Execution haltedr-oldrel-windows-x86_64
Running 'testthat.R' [57s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> library(testthat)
> library(parsnip)
> library(generics)
Attaching package: 'generics'
The following objects are masked from 'package:base':
as.difftime, as.factor, as.ordered, intersect, is.element, setdiff,
setequal, union
> library(spsurv)
Loading required package: survival
Loading required package: coda
> veteran <- survival::veteran
>
> test_check("spsurv")
SAMPLING FOR MODEL 'spbp' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.00011 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 1.1 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: WARNING: No variance estimation is
Chain 1: performed for num_warmup < 20
Chain 1:
Chain 1: Iteration: 1 / 10 [ 10%] (Warmup)
Chain 1: Iteration: 2 / 10 [ 20%] (Warmup)
Chain 1: Iteration
...[truncated]...
0
factor(celltype)large 0.097 0.097 0.1
---
DIC = 2885 WAIC = -1443
[ FAIL 1 | WARN 52 | SKIP 1 | PASS 685 ]
══ Skipped tests (1) ═══════════════════════════════════════════════════════════
• Set SPSURV_RUN_COVERAGE=true to run coverage check (1): 'test-coverage.R:6:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-interval.R:18:3'): confint with custom level ───────────────────
Error in `array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), NULL) else NULL)`: 'data' must be of a vector type, was 'NULL'
Backtrace:
▆
1. ├─stats::confint(fit, level = 0.9) at test-interval.R:18:3
2. └─spsurv:::confint.spbp(fit, level = 0.9)
3. ├─base::diag(as.matrix(vcov(object)))
4. ├─base::as.matrix(vcov(object))
5. └─base::as.matrix.default(vcov(object))
6. └─base::array(...)
[ FAIL 1 | WARN 52 | SKIP 1 | PASS 685 ]
Error:
! Test failures.
Execution haltedr-release-macos-x86_64
Running ‘testthat.R’ [32s/63s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(parsnip)
> library(generics)
Attaching package: 'generics'
The following objects are masked from 'package:base':
as.difftime, as.factor, as.ordered, intersect, is.element, setdiff,
setequal, union
> library(spsurv)
Loading required package: survival
Loading required package: coda
> veteran <- survival::veteran
>
> test_check("spsurv")
SAMPLING FOR MODEL 'spbp' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 6.3e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.63 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: WARNING: No variance estimation is
Chain 1: performed for num_warmup < 20
Chain 1:
Chain 1: Iteration: 1 / 10 [ 10%] (Warmup)
Chain 1: Iteration: 2 / 10 [ 20%] (Warmup)
Chain 1: Iter
...[truncated]...
. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
9. ├─stats::vcov(fit, bp.param = TRUE)
10. └─spsurv:::vcov.spbp(fit, bp.param = TRUE)
11. └─spsurv:::.spbp_sym_inv(Schur_A)
── Error ('test-vcov.R:166:3'): ill-conditioned gamma warning appears only for survfit, not after fit ──
Error: symmetric inverse requires a finite numeric matrix
Backtrace:
▆
1. ├─testthat::expect_silent(vcov(fit)) at test-vcov.R:166:3
2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
3. │ ├─testthat (local) .capture(...)
4. │ │ ├─withr::with_output_sink(...)
5. │ │ │ └─base::force(code)
6. │ │ ├─base::withCallingHandlers(...)
7. │ │ └─base::withVisible(code)
8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
9. ├─stats::vcov(fit)
10. └─spsurv:::vcov.spbp(fit)
11. └─spsurv:::.spbp_sym_inv(Schur_A)
[ FAIL 3 | WARN 46 | SKIP 1 | PASS 672 ]
Error:
! Test failures.
Execution halted- ERROR10 OK, 3 ERRORNow
- ERROR4 OK, 2 ERROR2026-09-29
- OK6 OK2026-09-28
- NOTE9 OK, 4 NOTE2026-06-09
- ERROR9 OK, 3 NOTE, 1 ERROR2026-06-08
- NOTE7 OK, 7 NOTE2026-04-22
Show 2 earlier changesHide 2 earlier changes
- ERROR6 OK, 7 NOTE, 1 ERROR2026-04-18
- NOTE7 OK, 7 NOTE2026-03-10
Documentation
- Help pages
- 54 (10 internal)includes a package overview page
- Examples that run
- 83%10 run in a plain check · 2 never run
- Exported functions with examples
- 32%
- Documented parameters
- 71%
- Return-value docs
- 73%
- Help pages citing references
- 2%
- Bayesian analysis with Stan HTML
- Bernstein polynomial degree and baseline plots HTML
- Choosing PH, PO, and AFT models HTML
- Getting started with spsurv HTML
- Inference and model comparison (MLE) HTML
- Model checking and residuals HTML
- Survival prediction and ggplot workflows HTML
- tidymodels and tidybayes integration HTML
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 508
- Median days to close, 50 most recently updated closed PRs
- 0
Issues over time
Commits over time
9 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/rvpanaro/spsurv on 2026-10-11.
The R CMD check workflow runs on Linux
GitHub Pages site last deployed 2026-10-04 · The repository has a site deploy workflow
pkgdown site last built 2026-10-04
Show all practicesHide 1 practice
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- unarchivedReturned to CRAN2026-09-28
- 1.1.0Latest2026-09-28 · current release · diff ↗ ·
removed 9 exports
coef, confint, extract, itsamp, mode, stan_dens, survivor, traceplot, vcovadded 17 exports
as_draws_df.spbp, bernstein, bp_survival_reg, credint, estimates, ggresiduals, proportional_odds, pw.basis, rank_models, se, spread_surv_draws.spbp, spsurv_fit_proportional_hazards, spsurv_fit_proportional_odds, spsurv_fit_survival_reg, spsurv_pred_linear_pred, spsurv_pred_survival, spsurv_pred_time - archivedRemoved from CRAN2026-06-11email to the maintainer is undeliverable
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- 1.0.02020-03-31
- RR 3.6.0 released · 2019-04-26
Package metadata
- First published
- 2020-03-31
- Total releases
- 2 / 6 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 1.1 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("spsurv")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.