Package: fitPS 1.1.4

fitPS: Fit Probability Models to Forensic Survey Data

Fits probability models to P- and S-type count data arising from forensic surveys of clothing for the background presence of glass, paint, and related trace material. Built-in models include zeta, zero-inflated zeta, and logarithmic distributions, with a public extension interface for additional models. Inference is available by maximum likelihood, parametric Bayesian methods, the ordinary nonparametric bootstrap, and Rubin's Bayesian Bootstrap. The clothing-survey setting is described by Coulson, Buckleton, Gummer, and Triggs (2001) <doi:10.1016/S1355-0306(01)71847-3>.

Authors:James Curran [aut, cre]

fitPS_1.1.4.tar.gz
fitPS_1.1.4.zip(r-4.7-any)fitPS_1.1.4.zip(r-4.6-any)fitPS_1.1.4.zip(r-4.5-any)
fitPS_1.1.4.tgz(r-4.6-any)fitPS_1.1.4.tgz(r-4.5-any)
fitPS_1.1.4.tar.gz(r-4.7-any)fitPS_1.1.4.tar.gz(r-4.6-any)
fitPS_1.1.4.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
fitPS/json (API)

# Install 'fitPS' in R:
install.packages('fitPS', repos = c('https://jmcurran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/jmcurran/fitps/issues

Datasets:
  • Psurveys - Number of Groups of Glass Data
  • Ssurveys - Size of Groups of Glass Data

On CRAN:

Conda:

4.95 score 15 scripts 393 downloads 47 exports 91 dependencies

Last updated from:fdd9f2b490. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK262
source / vignettesOK311
linux-releaseOK245
macos-releaseOK210
macos-oldrelOK217
windows-develOK264
windows-releaseOK262
windows-oldrelOK225
wasm-releaseOK134

Exports:addbootCIbootstrapFitbootstrapProbscompareSurveyscompareSurveysLRTcreatePSDatacredintcredIntDICfitfitdistfitDistfitlogdistfitlogDistfitLogdistfitzidistfitZIdistfitZIDistlogarithmicModelmakeDatamakePriormakePSDatamodelBayesControlmodelFromUnconstrainedmodelLogJacobianmodelLogLikelihoodmodelLogPriormodelMleControlmodelObservationDatamodelParameterNamesmodelProbabilitiesmodelToUnconstrainedplotPosteriorplotUncertaintyposteriorInflationposteriorProbsprobfunpsModelreadDatarzetarzizetarZIzetasupportedPosteriorEnginesvarzetaModelzizModel

Dependencies:backportsbase64encbslibcachemcellrangercheckmatecliclustercodetoolscolorspacecpp11crayoncubaturedata.tabledigestdoParalleldplyrevaluatefarverfastmapFNNfontawesomeforeachforeignFormulafsgenericsggplot2gluegridExtragtablehighrHmischmshtmlTablehtmltoolshtmlwidgetsisobanditeratorsjquerylibjsonlitekernlabKernSmoothknitrkslabelinglatticelifecyclemagrittrMatrixmclustmemoisemgcvmimemulticoolmvtnormnlmennetpbapplypillarpkgconfigpracmaprettyunitsprogressR6rappdirsrbibutilsRColorBrewerRcppRdpackreadxlrematchrlangrmarkdownrpartrstudioapiS7sassscalesstringistringrtibbletidyselecttinytexutf8vctrsVGAMviridisLitewithrxfunyaml

Getting started with fitPS
Fitting a zeta distribution | Using the fitted distribution to estimate P terms | Fitting a zero-inflated zeta distribution | Confidence intervals for the parameter estimates | Profile-likelihood and bootstrap confidence regions for the zero-inflated zeta | Comparing two surveys | References

Last update: 2026-08-16
Started: 2026-08-15

Quantifying uncertainty with fitPS
Two kinds of uncertainty | Four approaches available in fitPS | Fit the ZIZ model | Confidence and credible regions for the parameters | Comparing parameter uncertainty across the four methods | From parameter uncertainty to probability uncertainty | Comparing the probability estimates | What does the inflation parameter mean? | Which method should I use? | References

Last update: 2026-08-16
Started: 2026-08-15

Adding a new model to fitPS
When to add a new model | What a model must provide | Why MCMC needs unconstrained parameters | [\log p(z\mid x) | P and S surveys shift the probability sequence | Example 1: an external Poisson model | Construct the model | Supply the observation mapping | Supply probabilities | Supply the log likelihood | Add the Bayesian mathematics | Register the external S3 methods | Fit and use the model | Example 2: a Poisson-normal model with mu and sigma | [P(Y = y \mid \mu, \sigma) | [g(k; \mu, \sigma) | [\ell(\mu,\sigma) | Construct the two-parameter descriptor | Map the data and choose starting values | [\operatorname{Var}(Y) | Evaluate the marginal probability by numerical integration | Add Bayesian methods for the Poisson-normal model | Register the Poisson-normal methods | Fit the two-parameter model | Bayesian fitting of the external two-parameter model | Serialization and retained model objects | What an extension package should contain | Practical lessons from the two examples

Last update: 2026-08-16
Started: 2026-08-15

Model comparison with fitPS
Why compare models? | Maximum-likelihood comparison | Bayesian fits and DIC | Look at the fitted probabilities | Parameter uncertainty and predictive probabilities | What should be concluded? | References

Last update: 2026-08-16
Started: 2026-08-15

Readme and manuals

Help Manual

Help pageTopics
S3 method for objects of class 'psData'==.psData
Add data to a psData objectadd
Converts an object of class 'psData' to a 'data.frame'as.data.frame.psData
Legacy bootstrap confidence intervals or regionsbootCI bootCI.default bootCI.psData bootCI.psFit
Compute a bootstrap distribution for a fitted fitPS modelbootstrapFit bootstrapFit.psFit
Extract bootstrap probability summariesbootstrapProbs bootstrapProbs.psBootstrap bootstrapProbs.psFit
Compare two surveys on the basis of their shape parameterscomp.survs compare.surveys compareSurveys compareSurveys.default compareSurveys.psData compareSurveys.psFit
Compare two or more surveys on the basis of their shape parameters using a Likelihood Ratio TestcompareSurveysLRT
S3 confint method for objects of class psFitconfint.psFit
Bayesian credible intervals or regionscredInt credint
Extract deviance from a fitted fitPS modeldeviance.psFit
Compute the deviance information criterion for a Bayesian fitPS modelDIC
Fit a fitPS modelfit
Fit a Zeta Distribution to Forensic DatafitDist fitdist
Fit a logarithmic distribution to forensic datafitLogdist fitlogDist fitlogdist
S3 fitted method for an object of class 'psFit'fitted.psFit
Extract posterior mean probabilitiesfitted.psPosterior
Fit a Zero-Inflated Zeta Distribution to Forensic DatafitZIDist fitZIdist fitzidist
Construct built-in fitPS model descriptorslogarithmicModel zetaModel zizModel
Extract the maximised log-likelihood from a fitPS model fitlogLik.psFit
Define a prior densitymakePrior
Create a survey data set manuallycreatePSData makeData makePSData
An S3 method for computing the mean of clothing survey for the number of groups or size of groupsmean.psData
Return Bayesian fitting controls supplied by a modelmodelBayesControl modelBayesControl.logarithmicModel modelBayesControl.psModel modelBayesControl.zetaModel modelBayesControl.zizModel
Transform unconstrained coordinates to natural model parametersmodelFromUnconstrained modelFromUnconstrained.logarithmicModel modelFromUnconstrained.psModel modelFromUnconstrained.zetaModel modelFromUnconstrained.zizModel
Evaluate the log-Jacobian for the unconstrained parameter transformationmodelLogJacobian modelLogJacobian.logarithmicModel modelLogJacobian.psModel modelLogJacobian.zetaModel modelLogJacobian.zizModel
Evaluate a model log likelihood through the shared model protocol.modelLogLikelihood
Evaluate a model prior on the natural parameter scalemodelLogPrior modelLogPrior.logarithmicModel modelLogPrior.psModel modelLogPrior.zetaModel modelLogPrior.zizModel
Return generic maximum-likelihood controls for a modelmodelMleControl modelMleControl.psModel
Convert fitPS data to the observation support required by a model.modelObservationData
Return the natural parameter names declared by a fitPS model.modelParameterNames
Evaluate fitted P/S probabilities through a model descriptor.modelProbabilities
Transform natural model parameters to unconstrained coordinatesmodelToUnconstrained modelToUnconstrained.logarithmicModel modelToUnconstrained.psModel modelToUnconstrained.zetaModel modelToUnconstrained.zizModel
Plot bootstrap probability summariesplot.psBootstrap
S3 plot method for an object of class 'psFit'plot.psFit
Plot posterior probability summariesplot.psPosterior
Plot a posterior density for a fitted power-series modelplotPosterior
Plot parameter uncertainty for a fitPS inferential resultplotUncertainty plotUncertainty.psBayesianBootstrap plotUncertainty.psBootstrap plotUncertainty.psFit
Posterior probability of practically negligible inflationposteriorInflation posteriorInflation.psFit posteriorInflation.psPosterior
Extract posterior probability summariesposteriorProbs posteriorProbs.psFit posteriorProbs.psPosterior
S3 predict method for an object of class 'psFit'predict.psFit
Print a fitPS Bayesian Bootstrap objectprint.psBayesianBootstrap
Print a fitPS bootstrap objectprint.psBootstrap
S3 print method for an object of class 'psData'print.psData
S3 print method for an object of class 'psFit'print.psFit
Print a fitPS posterior objectprint.psPosterior
Plug-in probability functionsprobfun
Construct a public fitPS model descriptorpsModel
Number of Groups of Glass DataPsurveys
Read count data from filereadData
Generate random variates from a zeta distributionrzeta
Generate zero inflated zeta random variatesrZIzeta rzizeta
Size of Groups of Glass DataSsurveys
Summarise a fitPS Bayesian Bootstrap objectprint.summary.psBayesianBootstrap summary.psBayesianBootstrap
Summarise a fitPS bootstrap objectprint.summary.psBootstrap summary.psBootstrap
S3 summary method for an object of class 'psFit'summary.psFit
Summarise a fitPS posterior objectprint.summary.psPosterior summary.psPosterior
Return posterior engines supported by a fitPS model.supportedPosteriorEngines
Variance genericvar var.default
An S3 method for computing the variance of clothing survey for the number of groups or size of groupsvar.psData