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

  • 1d9c7b6
  • /
  • fit_params.Rd
Raw File Download

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
content badge
swh:1:cnt:a421821e116ecc257c840d0dcfb8bd9e8061ecda
directory badge
swh:1:dir:1d9c7b6faaf4c1560ce4c815112d299a54a37f79

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
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
fit_params.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/par_est_fns.R
\name{fit_params}
\alias{fit_params}
\title{Functions to estimate parameters of probability distributions by fitting the distributions using optim()}
\usage{
fit_params(x, type, optim_control = list(maxit = 1000))
}
\arguments{
\item{x}{Vector containing the discrete observations}

\item{type}{Keyword for the probability distribution the data is to be fitted
against. Possible values are ("pois", "nb", "del", pig", "pb", "pois2", "nb2", "del2", "pig2"
 "pb2", "zipois", "zinb", "zidel", "zipg", zipb", "zipois2", "zinb2", "zidel2", "zipig2", zipb2")}

\item{optim_control}{List of options to override presets in
the optim function; Set to list(maxit = 1000) by default.
For more details, please refer to the 'control' parameter in the
standard 'optim' function in package 'stats'.}
}
\description{
Functions to estimate parameters of probability distributions by fitting the distributions using optim()
}
\examples{
x1 <- rnbinom(100, size = 13, mu = 9)
p1 <- fit_params(x1, "nb")
s <- sample(x = c(0,1), size = 100, replace = TRUE, prob = c(0.3,0.7))
x2 <- s*x1 + (1-s) * rnbinom(100, size = 15, mu = 53)
p2 <- fit_params(x2, "nb2")
}
\keyword{estimation}
\keyword{parameter}

back to top

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— Content policy— Contact— JavaScript license information— Web API