Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cran/rstpm2
16 March 2023, 11:13:04 UTC
  • Code
  • Branches (20)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/1.2.2
    • refs/tags/1.3.1
    • refs/tags/1.3.2
    • refs/tags/1.3.4
    • refs/tags/1.4.0
    • refs/tags/1.4.1
    • refs/tags/1.4.2
    • refs/tags/1.4.4
    • refs/tags/1.4.5
    • refs/tags/1.5.0
    • refs/tags/1.5.1
    • refs/tags/1.5.2
    • refs/tags/1.5.5
    • refs/tags/1.5.6
    • refs/tags/1.5.7
    • refs/tags/1.5.8
    • refs/tags/1.5.9
    • refs/tags/1.6.1
    • refs/tags/1.6.2
    No releases to show
  • 4c2255a
  • /
  • tests
  • /
  • testthat
  • /
  • test_zeroModel.R
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:2013eaf9862d166121d28cf8ebc7d2b610f02dee
origin badgedirectory badge Iframe embedding
swh:1:dir:f10096d0aa097e87998d52971f958c4568774957
origin badgerevision badge
swh:1:rev:936fa1723eb80b0f9d4b12a1e50e5c542b549b35
origin badgesnapshot badge
swh:1:snp:6a0ac420dcf26f4ce7b9c8b5d3c5816f5620bd13
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 936fa1723eb80b0f9d4b12a1e50e5c542b549b35 authored by Mark Clements on 03 March 2021, 16:10:02 UTC
version 1.5.2
Tip revision: 936fa17
test_zeroModel.R
library(rstpm2)

expect_eps <- function(expr, value, eps=1e-7)
    expect_lt(max(abs(expr-value)),eps)

context("zeroModel")
##
test_that("base", {
    x <- 1:10
    y <- c(1:9,11)
    d <- data.frame(x,y)
    fit <- zeroModel(lm(y~x,data=d))
    expect_eps(coef(fit), c(0,0), 1e-10)
    expect_eps(vcov(fit), matrix(0,2,2), 1e-10)
    ## expect_eps(predict(fit,newdata=d), rep(0,10), 1e-10) # zeroModel class not exported
})

context("hrModel")
##
test_that("base", {
    x <- 1:10
    y <- c(1:9,11)
    fit <- hrModel(glm(y~x,family=poisson),2,ci=c(1,4))
    expect_eps(coef(fit), c(0.4577646, 0.2007416, 0.6931472), 1e-5)
    expect_eps(vcov(fit),
               matrix(c(0.148392636125595, -0.0185062979900643, 0,
                        -0.0185062979900643, 0.00262367771332864, 0,
                        0, 0, 0.125070457954665),3,3), 1e-10)
    expect_eps(predict(fit), predict.glm(fit$base,type="haz")*2, 1e-10)
    expect_eps(predict(fit,type="gradh"),
               cbind(predict.glm(fit$base,type="gradh")*2,
                     predict.glm(fit$base,type="haz")*2),
               1e-10)
})

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top