knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
gof4srm provides Kolmogorov-Smirnov test for both time and grouped data, and EIC (extended information criterion) for software reliability growth models.
You can install gof4srm from GitHub with:
install.packages("devtools") devtools::install_github("SwReliab/gof4srm")
Alternatively, you can use Remote to install Rsrat from GitHub
install.packages("remotes") remotes::install_github("SwReliab/gof4srm")
This is an example of the estimation of software reliability growth models from a fault data (sys1g).
### load library library(gof4srm) ### load example data data(dacs) ### grouped data from DACS sys1g ### Esimate all models (result <- fit.srm.nhpp(fault=sys1g, selection=NULL)) ### Draw the graph mvfplot(fault=sys1g, srms=result) ### Draw the graph (dmvf) dmvfplot(fault=sys1g, srms=result)
Perform KS test with the significance level 0.05.
### KS test ksres <- lapply(result, ks.srm.test) ### Table for P-value pvalue <- sapply(ksres, function(x) x$p.value) data.frame(p.value=pvalue, reject0.05=ifelse(pvalue < 0.05, "*", "")) ### MVF for the models that are passed mvfplot(fault=sys1g, srms=result[pvalue >= 0.05]) ### MVF for the models that are passed dmvfplot(fault=sys1g, srms=result[pvalue >= 0.05])
Compute EIC
### EIC eicres <- lapply(result, eic.srm) ### Table for EIC eic <- sapply(eicres, function(x) x$eic) eic.lower <- sapply(eicres, function(x) x$eic.lower) eic.upper <- sapply(eicres, function(x) x$eic.upper) aic <- sapply(result, function(x) x$aic) data.frame(aic=aic, eic=eic, eic.lower=eic.lower, eic.upper=eic.upper, ks.p.value=pvalue)
This is an example of the estimation of software reliability growth models from a fault data (sys1g).
### Install Rphsrm install.packages("remotes") remotes::install_github("SwReliab/Rphsrm")
### load library library(Rphsrm) ### Esimate several phases (result <- fit.srm.cph(fault=sys1g, phase=c(10,20,30,40,50), selection=NULL)) ### Draw the graph mvfplot(fault=sys1g, srms=result) ### Draw the graph (dmvf) dmvfplot(fault=sys1g, srms=result)
Perform KS test with the significance level 0.05.
### KS test ksres <- lapply(result, ks.srm.test) ### Table for P-value pvalue <- sapply(ksres, function(x) x$p.value) data.frame(p.value=pvalue, reject0.05=ifelse(pvalue < 0.05, "*", "")) ### MVF for the models that are passed mvfplot(fault=sys1g, srms=result[pvalue >= 0.05]) ### MVF for the models that are passed dmvfplot(fault=sys1g, srms=result[pvalue >= 0.05])
Compute EIC
### EIC eicres <- lapply(result, eic.srm) ### Table for EIC eic <- sapply(eicres, function(x) x$eic) eic.lower <- sapply(eicres, function(x) x$eic.lower) eic.upper <- sapply(eicres, function(x) x$eic.upper) aic <- sapply(result, function(x) x$aic) data.frame(aic=aic, eic=eic, eic.lower=eic.lower, eic.upper=eic.upper, ks.p.value=pvalue)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.