├── .Rbuildignore ├── .github ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md └── workflows │ ├── R-CMD-check.yaml │ ├── pkgdown.yaml │ ├── pr-commands.yaml │ └── test-coverage.yaml ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── NEWS.md ├── R ├── Bernoulli.R ├── Beta.R ├── Binomial.R ├── Categorical.R ├── Cauchy.R ├── ChiSquare.R ├── Erlang.R ├── Exponential.R ├── FIFA2018.R ├── FisherF.R ├── Frechet.R ├── Gamma.R ├── GeneralisedExtremeValue.R ├── GeneralisedPareto.R ├── Geometric.R ├── Gumbel.R ├── HurdleNegativeBinomial.R ├── HurdlePoisson.R ├── HyperGeometric.R ├── LogNormal.R ├── Logistic.R ├── Multinomial.R ├── NegativeBinomial.R ├── Normal.R ├── Poisson.R ├── PoissonBinomial.R ├── ReversedWeibull.R ├── StudentsT.R ├── Tukey.R ├── Uniform.R ├── Weibull.R ├── ZINegativeBinomial.R ├── ZIPoisson.R ├── ZTNegativeBinomial.R ├── ZTPoisson.R ├── distributions3-package.R ├── is_discrete.R ├── methods.R ├── plot.R ├── prodist.R ├── simulate.default.R ├── tibble-vctrs.R └── utils.R ├── README.Rmd ├── README.md ├── _pkgdown.yml ├── codecov.yml ├── cran-comments.md ├── data └── FIFA2018.rda ├── distributions3.Rproj ├── inst └── WORDLIST ├── man ├── Bernoulli.Rd ├── Beta.Rd ├── Binomial.Rd ├── Categorical.Rd ├── Cauchy.Rd ├── ChiSquare.Rd ├── Erlang.Rd ├── Exponential.Rd ├── FIFA2018.Rd ├── FisherF.Rd ├── Frechet.Rd ├── GEV.Rd ├── GP.Rd ├── Gamma.Rd ├── Geometric.Rd ├── Gumbel.Rd ├── HurdleNegativeBinomial.Rd ├── HurdlePoisson.Rd ├── HyperGeometric.Rd ├── LogNormal.Rd ├── Logistic.Rd ├── Multinomial.Rd ├── NegativeBinomial.Rd ├── Normal.Rd ├── Poisson.Rd ├── PoissonBinomial.Rd ├── RevWeibull.Rd ├── StudentsT.Rd ├── Tukey.Rd ├── Uniform.Rd ├── Weibull.Rd ├── ZINegativeBinomial.Rd ├── ZIPoisson.Rd ├── ZTNegativeBinomial.Rd ├── ZTPoisson.Rd ├── apply_dpqr.Rd ├── cdf.Bernoulli.Rd ├── cdf.Beta.Rd ├── cdf.Binomial.Rd ├── cdf.Categorical.Rd ├── cdf.Cauchy.Rd ├── cdf.ChiSquare.Rd ├── cdf.Erlang.Rd ├── cdf.Exponential.Rd ├── cdf.FisherF.Rd ├── cdf.Frechet.Rd ├── cdf.GEV.Rd ├── cdf.GP.Rd ├── cdf.Gamma.Rd ├── cdf.Geometric.Rd ├── cdf.Gumbel.Rd ├── cdf.HurdleNegativeBinomial.Rd ├── cdf.HurdlePoisson.Rd ├── cdf.HyperGeometric.Rd ├── cdf.LogNormal.Rd ├── cdf.Logistic.Rd ├── cdf.NegativeBinomial.Rd ├── cdf.Normal.Rd ├── cdf.Poisson.Rd ├── cdf.PoissonBinomial.Rd ├── cdf.Rd ├── cdf.RevWeibull.Rd ├── cdf.StudentsT.Rd ├── cdf.Tukey.Rd ├── cdf.Uniform.Rd ├── cdf.Weibull.Rd ├── cdf.ZINegativeBinomial.Rd ├── cdf.ZIPoisson.Rd ├── cdf.ZTNegativeBinomial.Rd ├── cdf.ZTPoisson.Rd ├── distributions3-package.Rd ├── fit_mle.Bernoulli.Rd ├── fit_mle.Binomial.Rd ├── fit_mle.Exponential.Rd ├── fit_mle.Gamma.Rd ├── fit_mle.Geometric.Rd ├── fit_mle.LogNormal.Rd ├── fit_mle.Normal.Rd ├── fit_mle.Poisson.Rd ├── fit_mle.Rd ├── geom_auc.Rd ├── hnbinom.Rd ├── hpois.Rd ├── is_discrete.Rd ├── is_distribution.Rd ├── log_likelihood.Rd ├── pdf.Bernoulli.Rd ├── pdf.Beta.Rd ├── pdf.Binomial.Rd ├── pdf.Categorical.Rd ├── pdf.Cauchy.Rd ├── pdf.ChiSquare.Rd ├── pdf.Erlang.Rd ├── pdf.Exponential.Rd ├── pdf.FisherF.Rd ├── pdf.Frechet.Rd ├── pdf.GEV.Rd ├── pdf.GP.Rd ├── pdf.Gamma.Rd ├── pdf.Geometric.Rd ├── pdf.Gumbel.Rd ├── pdf.HurdleNegativeBinomial.Rd ├── pdf.HurdlePoisson.Rd ├── pdf.HyperGeometric.Rd ├── pdf.LogNormal.Rd ├── pdf.Logistic.Rd ├── pdf.Multinomial.Rd ├── pdf.NegativeBinomial.Rd ├── pdf.Normal.Rd ├── pdf.Poisson.Rd ├── pdf.PoissonBinomial.Rd ├── pdf.Rd ├── pdf.RevWeibull.Rd ├── pdf.StudentsT.Rd ├── pdf.Uniform.Rd ├── pdf.Weibull.Rd ├── pdf.ZINegativeBinomial.Rd ├── pdf.ZIPoisson.Rd ├── pdf.ZTNegativeBinomial.Rd ├── pdf.ZTPoisson.Rd ├── plot.distribution.Rd ├── plot_cdf.Rd ├── plot_pdf.Rd ├── prodist.Rd ├── quantile.Bernoulli.Rd ├── quantile.Beta.Rd ├── quantile.Binomial.Rd ├── quantile.Categorical.Rd ├── quantile.Cauchy.Rd ├── quantile.ChiSquare.Rd ├── quantile.Erlang.Rd ├── quantile.Exponential.Rd ├── quantile.FisherF.Rd ├── quantile.Frechet.Rd ├── quantile.GEV.Rd ├── quantile.GP.Rd ├── quantile.Gamma.Rd ├── quantile.Geometric.Rd ├── quantile.Gumbel.Rd ├── quantile.HurdleNegativeBinomial.Rd ├── quantile.HurdlePoisson.Rd ├── quantile.HyperGeometric.Rd ├── quantile.LogNormal.Rd ├── quantile.Logistic.Rd ├── quantile.NegativeBinomial.Rd ├── quantile.Normal.Rd ├── quantile.Poisson.Rd ├── quantile.PoissonBinomial.Rd ├── quantile.RevWeibull.Rd ├── quantile.StudentsT.Rd ├── quantile.Tukey.Rd ├── quantile.Uniform.Rd ├── quantile.Weibull.Rd ├── quantile.ZINegativeBinomial.Rd ├── quantile.ZIPoisson.Rd ├── quantile.ZTNegativeBinomial.Rd ├── quantile.ZTPoisson.Rd ├── random.Bernoulli.Rd ├── random.Beta.Rd ├── random.Binomial.Rd ├── random.Categorical.Rd ├── random.Cauchy.Rd ├── random.ChiSquare.Rd ├── random.Erlang.Rd ├── random.Exponential.Rd ├── random.FisherF.Rd ├── random.Frechet.Rd ├── random.GEV.Rd ├── random.GP.Rd ├── random.Gamma.Rd ├── random.Geometric.Rd ├── random.Gumbel.Rd ├── random.HurdleNegativeBinomial.Rd ├── random.HurdlePoisson.Rd ├── random.HyperGeometric.Rd ├── random.LogNormal.Rd ├── random.Logistic.Rd ├── random.Multinomial.Rd ├── random.NegativeBinomial.Rd ├── random.Normal.Rd ├── random.Poisson.Rd ├── random.PoissonBinomial.Rd ├── random.Rd ├── random.RevWeibull.Rd ├── random.StudentsT.Rd ├── random.Tukey.Rd ├── random.Uniform.Rd ├── random.Weibull.Rd ├── random.ZINegativeBinomial.Rd ├── random.ZIPoisson.Rd ├── random.ZTNegativeBinomial.Rd ├── random.ZTPoisson.Rd ├── simulate.default.Rd ├── suff_stat.Bernoulli.Rd ├── suff_stat.Binomial.Rd ├── suff_stat.Exponential.Rd ├── suff_stat.Gamma.Rd ├── suff_stat.Geometric.Rd ├── suff_stat.LogNormal.Rd ├── suff_stat.Normal.Rd ├── suff_stat.Poisson.Rd ├── suff_stat.Rd ├── support.Bernoulli.Rd ├── support.Beta.Rd ├── support.Binomial.Rd ├── support.Cauchy.Rd ├── support.ChiSquare.Rd ├── support.Erlang.Rd ├── support.Exponential.Rd ├── support.FisherF.Rd ├── support.Frechet.Rd ├── support.GEV.Rd ├── support.GP.Rd ├── support.Gamma.Rd ├── support.Geometric.Rd ├── support.Gumbel.Rd ├── support.HurdleNegativeBinomial.Rd ├── support.HurdlePoisson.Rd ├── support.HyperGeometric.Rd ├── support.LogNormal.Rd ├── support.Logistic.Rd ├── support.NegativeBinomial.Rd ├── support.Normal.Rd ├── support.Poisson.Rd ├── support.PoissonBinomial.Rd ├── support.Rd ├── support.RevWeibull.Rd ├── support.StudentsT.Rd ├── support.Tukey.Rd ├── support.Uniform.Rd ├── support.Weibull.Rd ├── support.ZINegativeBinomial.Rd ├── support.ZIPoisson.Rd ├── support.ZTNegativeBinomial.Rd ├── support.ZTPoisson.Rd ├── variance.Rd ├── vec_proxy.distribution.Rd ├── zinbinom.Rd ├── zipois.Rd ├── ztnbinom.Rd └── ztpois.Rd ├── tests ├── testthat.R └── testthat │ ├── test-Bernoulli.R │ ├── test-Beta.R │ ├── test-Binomial.R │ ├── test-Categorical.R │ ├── test-Cauchy.R │ ├── test-ChiSquare.R │ ├── test-Erlang.R │ ├── test-Exponential.R │ ├── test-FisherF.R │ ├── test-Frechet.R │ ├── test-Gamma.R │ ├── test-GeneralisedExtremeValue.R │ ├── test-GeneralisedPareto.R │ ├── test-Geometric.R │ ├── test-Gumbel.R │ ├── test-HurdleNegativeBinomial.R │ ├── test-HurdlePoisson.R │ ├── test-HyperGeometric.R │ ├── test-LogNormal.R │ ├── test-Logistic.R │ ├── test-Multinomial.R │ ├── test-NegativeBinomial.R │ ├── test-Normal.R │ ├── test-Poisson.R │ ├── test-PoissonBinomial.R │ ├── test-RevWeibull.R │ ├── test-StudentsT.R │ ├── test-Tukey.R │ ├── test-Uniform.R │ ├── test-Weibull.R │ ├── test-ZINegativeBinomial.R │ ├── test-ZIPoisson.R │ ├── test-ZTNegativeBinomial.R │ ├── test-ZTPoisson.R │ ├── test-methods.R │ ├── test-plot.R │ ├── test-prodist.R │ ├── test-simulate.R │ └── test-utils.R └── vignettes ├── .gitignore ├── distributions3.bib ├── intro-to-hypothesis-testing.Rmd ├── one-sample-sign-tests.Rmd ├── one-sample-t-confidence-interval.Rmd ├── one-sample-t-test.Rmd ├── one-sample-z-confidence-interval.Rmd ├── one-sample-z-test-for-proportion.Rmd ├── one-sample-z-test.Rmd ├── paired-tests.Rmd ├── poisson.Rmd └── two-sample-z-test.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^distributions3\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^LICENSE\.md$ 4 | ^README\.Rmd$ 5 | ^\.github$ 6 | ^_pkgdown\.yml$ 7 | ^docs$ 8 | ^pkgdown$ 9 | ^\.travis\.yml$ 10 | ^codecov\.yml$ 11 | ^cran-comments\.md$ 12 | ^CRAN-RELEASE$ 13 | ^CRAN-SUBMISSION$ 14 | ^revdep$ 15 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, we pledge to respect all people who 4 | contribute through reporting issues, posting feature requests, updating documentation, 5 | submitting pull requests or patches, and other activities. 6 | 7 | We are committed to making participation in this project a harassment-free experience for 8 | everyone, regardless of level of experience, gender, gender identity and expression, 9 | sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. 10 | 11 | Examples of unacceptable behavior by participants include the use of sexual language or 12 | imagery, derogatory comments or personal attacks, trolling, public or private harassment, 13 | insults, or other unprofessional conduct. 14 | 15 | Project maintainers have the right and responsibility to remove, edit, or reject comments, 16 | commits, code, wiki edits, issues, and other contributions that are not aligned to this 17 | Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed 18 | from the project team. 19 | 20 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by 21 | opening an issue or contacting one or more of the project maintainers. 22 | 23 | This Code of Conduct is adapted from the Contributor Covenant 24 | (https://www.contributor-covenant.org), version 1.0.0, available at 25 | https://contributor-covenant.org/version/1/0/0/. 26 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | name: pkgdown 13 | 14 | permissions: read-all 15 | 16 | jobs: 17 | pkgdown: 18 | runs-on: ubuntu-latest 19 | # Only restrict concurrency for non-PR jobs 20 | concurrency: 21 | group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} 22 | env: 23 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 24 | permissions: 25 | contents: write 26 | steps: 27 | - uses: actions/checkout@v4 28 | 29 | - uses: r-lib/actions/setup-pandoc@v2 30 | 31 | - uses: r-lib/actions/setup-r@v2 32 | with: 33 | use-public-rspm: true 34 | 35 | - uses: r-lib/actions/setup-r-dependencies@v2 36 | with: 37 | extra-packages: any::pkgdown, local::. 38 | needs: website 39 | 40 | - name: Build site 41 | run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) 42 | shell: Rscript {0} 43 | 44 | - name: Deploy to GitHub pages 🚀 45 | if: github.event_name != 'pull_request' 46 | uses: JamesIves/github-pages-deploy-action@v4.5.0 47 | with: 48 | clean: false 49 | branch: gh-pages 50 | folder: docs 51 | -------------------------------------------------------------------------------- /.github/workflows/test-coverage.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: test-coverage 10 | 11 | permissions: read-all 12 | 13 | jobs: 14 | test-coverage: 15 | runs-on: ubuntu-latest 16 | env: 17 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 18 | 19 | steps: 20 | - uses: actions/checkout@v4 21 | 22 | - uses: r-lib/actions/setup-r@v2 23 | with: 24 | use-public-rspm: true 25 | 26 | - uses: r-lib/actions/setup-r-dependencies@v2 27 | with: 28 | extra-packages: any::covr, any::xml2 29 | needs: coverage 30 | 31 | - name: Test coverage 32 | run: | 33 | cov <- covr::package_coverage( 34 | quiet = FALSE, 35 | clean = FALSE, 36 | install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") 37 | ) 38 | covr::to_cobertura(cov) 39 | shell: Rscript {0} 40 | 41 | - uses: codecov/codecov-action@v4 42 | with: 43 | fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} 44 | file: ./cobertura.xml 45 | plugin: noop 46 | disable_search: true 47 | token: ${{ secrets.CODECOV_TOKEN }} 48 | 49 | - name: Show testthat output 50 | if: always() 51 | run: | 52 | ## -------------------------------------------------------------------- 53 | find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true 54 | shell: bash 55 | 56 | - name: Upload test results 57 | if: failure() 58 | uses: actions/upload-artifact@v4 59 | with: 60 | name: coverage-test-failures 61 | path: ${{ runner.temp }}/package 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .DS_Store 5 | docs/.DS_Store 6 | test/.DS_Store 7 | inst/doc 8 | docs 9 | revdep 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2022 2 | COPYRIGHT HOLDER: distributions3 authors 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2022 distributions3 authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /R/distributions3-package.R: -------------------------------------------------------------------------------- 1 | #' @keywords internal 2 | "_PACKAGE" 3 | 4 | ## usethis namespace: start 5 | #' @importFrom rlang .data 6 | #' @import stats 7 | #' @importFrom glue glue 8 | ## usethis namespace: end 9 | NULL 10 | -------------------------------------------------------------------------------- /R/is_discrete.R: -------------------------------------------------------------------------------- 1 | #' Determine whether a distribution is discrete or continuous 2 | #' 3 | #' Generic functions for determining whether a certain probability distribution 4 | #' is discrete or continuous, respectively. 5 | #' 6 | #' The generic function \code{is_discrete} is intended to return \code{TRUE} 7 | #' for every distribution whose entire support is discrete and \code{FALSE} 8 | #' otherwise. Analogously, \code{is_continuous} is intended to return \code{TRUE} 9 | #' for every distribution whose entire support is continuous and \code{FALSE} 10 | #' otherwise. For mixed discrete-continuous distributions both methods should 11 | #' return \code{FALSE}. 12 | #' 13 | #' Methods for both generics are provided for all \code{distribution} classes 14 | #' set up in this package. 15 | #' 16 | #' @param d An object. The package provides methods for distribution 17 | #' objects such as those from [Normal()] or [Binomial()] etc. 18 | #' @param ... Arguments passed to methods. Unevaluated arguments will generate a warning to 19 | #' catch mispellings or other possible errors. 20 | #' 21 | #' @return A logical vector indicating whether the distribution(s) in \code{d} 22 | #' is/are discrete or continuous, respectively. 23 | #' 24 | #' @examples 25 | #' X <- Normal() 26 | #' is_discrete(X) 27 | #' is_continuous(X) 28 | #' Y <- Binomial(size = 10, p = c(0.2, 0.5, 0.8)) 29 | #' is_discrete(Y) 30 | #' is_continuous(Y) 31 | #' @export 32 | is_discrete <- function(d, ...) { 33 | UseMethod("is_discrete") 34 | } 35 | 36 | #' @rdname is_discrete 37 | #' @export 38 | is_continuous <- function(d, ...) { 39 | UseMethod("is_continuous") 40 | } 41 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | 3 | coverage: 4 | status: 5 | project: 6 | default: 7 | target: auto 8 | threshold: 1% 9 | informational: true 10 | patch: 11 | default: 12 | target: auto 13 | threshold: 1% 14 | informational: true 15 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | Minor update 2 | 3 | ## Test environments 4 | 5 | * local ubuntu install, R 4.4.1 6 | * ubuntu (on Github Actions), R release, devel, 4.3, 4.2, 4.1, 4.0 7 | * windows (on Github Actions), R release 8 | * macOS (on Github Actions), R release 9 | 10 | ## Revdepchecks 11 | 12 | Failed to check one reverse dependency `imaginator`. Otherwise did not detect any new issues. 13 | 14 | ## R CMD check results 15 | 16 | 0 errors | 0 warnings | 0 notes 17 | -------------------------------------------------------------------------------- /data/FIFA2018.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexpghayes/distributions3/d110fe610d5eee16883f396dbe3a46b872e6daeb/data/FIFA2018.rda -------------------------------------------------------------------------------- /distributions3.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | 23 | QuitChildProcessesOnExit: Yes 24 | -------------------------------------------------------------------------------- /inst/WORDLIST: -------------------------------------------------------------------------------- 1 | CMD 2 | ChiSquare 3 | Codecov 4 | Extremal 5 | FisherF 6 | Frechet 7 | GEV 8 | Generalised 9 | Github 10 | HyperGeometric 11 | LogNormal 12 | Longleftrightarrow 13 | Moller 14 | NegativeBinomial 15 | ORCID 16 | PRs 17 | RevWeibull 18 | StudentsT 19 | Trane 20 | Unevaluated 21 | behaviour 22 | bernoulli 23 | binom 24 | cdf 25 | cdot 26 | colour 27 | eponynmous 28 | exponentiating 29 | frac 30 | ge 31 | infty 32 | ish 33 | ith 34 | le 35 | mathrm 36 | mispellings 37 | neq 38 | qquad 39 | rescaling 40 | rstats 41 | se 42 | th 43 | vectorized 44 | -------------------------------------------------------------------------------- /man/Beta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Beta.R 3 | \name{Beta} 4 | \alias{Beta} 5 | \title{Create a Beta distribution} 6 | \usage{ 7 | Beta(alpha = 1, beta = 1) 8 | } 9 | \arguments{ 10 | \item{alpha}{The alpha parameter. \code{alpha} can be any value strictly 11 | greater than zero. Defaults to \code{1}.} 12 | 13 | \item{beta}{The beta parameter. \code{beta} can be any value strictly 14 | greater than zero. Defaults to \code{1}.} 15 | } 16 | \value{ 17 | A \code{beta} object. 18 | } 19 | \description{ 20 | Create a Beta distribution 21 | } 22 | \examples{ 23 | 24 | set.seed(27) 25 | 26 | X <- Beta(1, 2) 27 | X 28 | 29 | random(X, 10) 30 | 31 | pdf(X, 0.7) 32 | log_pdf(X, 0.7) 33 | 34 | cdf(X, 0.7) 35 | quantile(X, 0.7) 36 | 37 | mean(X) 38 | variance(X) 39 | skewness(X) 40 | kurtosis(X) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 0.7)) 44 | } 45 | \seealso{ 46 | Other continuous distributions: 47 | \code{\link{Cauchy}()}, 48 | \code{\link{ChiSquare}()}, 49 | \code{\link{Erlang}()}, 50 | \code{\link{Exponential}()}, 51 | \code{\link{FisherF}()}, 52 | \code{\link{Frechet}()}, 53 | \code{\link{GEV}()}, 54 | \code{\link{GP}()}, 55 | \code{\link{Gamma}()}, 56 | \code{\link{Gumbel}()}, 57 | \code{\link{LogNormal}()}, 58 | \code{\link{Logistic}()}, 59 | \code{\link{Normal}()}, 60 | \code{\link{RevWeibull}()}, 61 | \code{\link{StudentsT}()}, 62 | \code{\link{Tukey}()}, 63 | \code{\link{Uniform}()}, 64 | \code{\link{Weibull}()} 65 | } 66 | \concept{continuous distributions} 67 | -------------------------------------------------------------------------------- /man/Categorical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Categorical.R 3 | \name{Categorical} 4 | \alias{Categorical} 5 | \title{Create a Categorical distribution} 6 | \usage{ 7 | Categorical(outcomes, p = NULL) 8 | } 9 | \arguments{ 10 | \item{outcomes}{A vector specifying the elements in the sample 11 | space. Can be numeric, factor, character, or logical.} 12 | 13 | \item{p}{A vector of success probabilities for each outcome. 14 | Each element of \code{p} can be any positive value -- the vector gets 15 | normalized internally. Defaults to \code{NULL}, in which case the 16 | distribution is assumed to be uniform.} 17 | } 18 | \value{ 19 | A \code{Categorical} object. 20 | } 21 | \description{ 22 | Create a Categorical distribution 23 | } 24 | \examples{ 25 | 26 | set.seed(27) 27 | 28 | X <- Categorical(1:3, p = c(0.4, 0.1, 0.5)) 29 | X 30 | 31 | Y <- Categorical(LETTERS[1:4]) 32 | Y 33 | 34 | random(X, 10) 35 | random(Y, 10) 36 | 37 | pdf(X, 1) 38 | log_pdf(X, 1) 39 | 40 | cdf(X, 1) 41 | quantile(X, 0.5) 42 | 43 | # cdfs are only defined for numeric sample spaces. this errors! 44 | # cdf(Y, "a") 45 | 46 | # same for quantiles. this also errors! 47 | # quantile(Y, 0.7) 48 | } 49 | \seealso{ 50 | Other discrete distributions: 51 | \code{\link{Bernoulli}()}, 52 | \code{\link{Binomial}()}, 53 | \code{\link{Geometric}()}, 54 | \code{\link{HurdleNegativeBinomial}()}, 55 | \code{\link{HurdlePoisson}()}, 56 | \code{\link{HyperGeometric}()}, 57 | \code{\link{Multinomial}()}, 58 | \code{\link{NegativeBinomial}()}, 59 | \code{\link{Poisson}()}, 60 | \code{\link{PoissonBinomial}()}, 61 | \code{\link{ZINegativeBinomial}()}, 62 | \code{\link{ZIPoisson}()}, 63 | \code{\link{ZTNegativeBinomial}()}, 64 | \code{\link{ZTPoisson}()} 65 | } 66 | \concept{discrete distributions} 67 | -------------------------------------------------------------------------------- /man/Erlang.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Erlang.R 3 | \name{Erlang} 4 | \alias{Erlang} 5 | \title{Create an Erlang distribution} 6 | \usage{ 7 | Erlang(k, lambda) 8 | } 9 | \arguments{ 10 | \item{k}{The shape parameter. Can be any positive integer number.} 11 | 12 | \item{lambda}{The rate parameter. Can be any positive number.} 13 | } 14 | \value{ 15 | An \code{Erlang} object. 16 | } 17 | \description{ 18 | The Erlang distribution is a two-parameter family of continuous probability 19 | distributions with support \eqn{x \in [0,\infty)}. 20 | The two parameters are a positive integer shape parameter \eqn{k} and a 21 | positive real rate parameter \eqn{\lambda}. 22 | The Erlang distribution with shape parameter \eqn{k = 1} simplifies to the 23 | exponential distribution, and it is a special case of the gamma distribution. 24 | It corresponds to a sum of \eqn{k} independent exponential variables with mean 25 | \eqn{1 / \lambda} each. 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Erlang(5, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 2) 37 | log_pdf(X, 2) 38 | 39 | cdf(X, 4) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 7)) 44 | } 45 | \seealso{ 46 | Other continuous distributions: 47 | \code{\link{Beta}()}, 48 | \code{\link{Cauchy}()}, 49 | \code{\link{ChiSquare}()}, 50 | \code{\link{Exponential}()}, 51 | \code{\link{FisherF}()}, 52 | \code{\link{Frechet}()}, 53 | \code{\link{GEV}()}, 54 | \code{\link{GP}()}, 55 | \code{\link{Gamma}()}, 56 | \code{\link{Gumbel}()}, 57 | \code{\link{LogNormal}()}, 58 | \code{\link{Logistic}()}, 59 | \code{\link{Normal}()}, 60 | \code{\link{RevWeibull}()}, 61 | \code{\link{StudentsT}()}, 62 | \code{\link{Tukey}()}, 63 | \code{\link{Uniform}()}, 64 | \code{\link{Weibull}()} 65 | } 66 | \concept{continuous distributions} 67 | -------------------------------------------------------------------------------- /man/FisherF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/FisherF.R 3 | \name{FisherF} 4 | \alias{FisherF} 5 | \title{Create an F distribution} 6 | \usage{ 7 | FisherF(df1, df2, lambda = 0) 8 | } 9 | \arguments{ 10 | \item{df1}{Numerator degrees of freedom. Can be any positive number.} 11 | 12 | \item{df2}{Denominator degrees of freedom. Can be any positive number.} 13 | 14 | \item{lambda}{Non-centrality parameter. Can be any positive number. 15 | Defaults to \code{0}.} 16 | } 17 | \value{ 18 | A \code{FisherF} object. 19 | } 20 | \description{ 21 | Create an F distribution 22 | } 23 | \details{ 24 | We recommend reading this documentation on 25 | \url{https://alexpghayes.github.io/distributions3/}, where the math 26 | will render with additional detail. 27 | 28 | TODO 29 | } 30 | \examples{ 31 | 32 | set.seed(27) 33 | 34 | X <- FisherF(5, 10, 0.2) 35 | X 36 | 37 | random(X, 10) 38 | 39 | pdf(X, 2) 40 | log_pdf(X, 2) 41 | 42 | cdf(X, 4) 43 | quantile(X, 0.7) 44 | 45 | cdf(X, quantile(X, 0.7)) 46 | quantile(X, cdf(X, 7)) 47 | } 48 | \seealso{ 49 | Other continuous distributions: 50 | \code{\link{Beta}()}, 51 | \code{\link{Cauchy}()}, 52 | \code{\link{ChiSquare}()}, 53 | \code{\link{Erlang}()}, 54 | \code{\link{Exponential}()}, 55 | \code{\link{Frechet}()}, 56 | \code{\link{GEV}()}, 57 | \code{\link{GP}()}, 58 | \code{\link{Gamma}()}, 59 | \code{\link{Gumbel}()}, 60 | \code{\link{LogNormal}()}, 61 | \code{\link{Logistic}()}, 62 | \code{\link{Normal}()}, 63 | \code{\link{RevWeibull}()}, 64 | \code{\link{StudentsT}()}, 65 | \code{\link{Tukey}()}, 66 | \code{\link{Uniform}()}, 67 | \code{\link{Weibull}()} 68 | } 69 | \concept{continuous distributions} 70 | -------------------------------------------------------------------------------- /man/Tukey.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Tukey.R 3 | \name{Tukey} 4 | \alias{Tukey} 5 | \title{Create a Tukey distribution} 6 | \usage{ 7 | Tukey(nmeans, df, nranges) 8 | } 9 | \arguments{ 10 | \item{nmeans}{Sample size for each range.} 11 | 12 | \item{df}{Degrees of freedom.} 13 | 14 | \item{nranges}{Number of groups being compared.} 15 | } 16 | \value{ 17 | A \code{Tukey} object. 18 | } 19 | \description{ 20 | Tukey's studentized range distribution, used for Tukey's 21 | honestly significant differences test in ANOVA. 22 | } 23 | \details{ 24 | We recommend reading this documentation on 25 | \url{https://alexpghayes.github.io/distributions3/}, where the math 26 | will render with additional detail and much greater clarity. 27 | 28 | \strong{Support}: \eqn{R^+}, the set of positive real numbers. 29 | 30 | Other properties of Tukey's Studentized Range Distribution 31 | are omitted, largely because the distribution is not fun 32 | to work with. 33 | } 34 | \examples{ 35 | 36 | set.seed(27) 37 | 38 | X <- Tukey(4L, 16L, 2L) 39 | X 40 | 41 | cdf(X, 4) 42 | quantile(X, 0.7) 43 | } 44 | \seealso{ 45 | Other continuous distributions: 46 | \code{\link{Beta}()}, 47 | \code{\link{Cauchy}()}, 48 | \code{\link{ChiSquare}()}, 49 | \code{\link{Erlang}()}, 50 | \code{\link{Exponential}()}, 51 | \code{\link{FisherF}()}, 52 | \code{\link{Frechet}()}, 53 | \code{\link{GEV}()}, 54 | \code{\link{GP}()}, 55 | \code{\link{Gamma}()}, 56 | \code{\link{Gumbel}()}, 57 | \code{\link{LogNormal}()}, 58 | \code{\link{Logistic}()}, 59 | \code{\link{Normal}()}, 60 | \code{\link{RevWeibull}()}, 61 | \code{\link{StudentsT}()}, 62 | \code{\link{Uniform}()}, 63 | \code{\link{Weibull}()} 64 | } 65 | \concept{continuous distributions} 66 | -------------------------------------------------------------------------------- /man/Uniform.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Uniform.R 3 | \name{Uniform} 4 | \alias{Uniform} 5 | \title{Create a Continuous Uniform distribution} 6 | \usage{ 7 | Uniform(a = 0, b = 1) 8 | } 9 | \arguments{ 10 | \item{a}{The a parameter. \code{a} can be any value in the set of real 11 | numbers. Defaults to \code{0}.} 12 | 13 | \item{b}{The a parameter. \code{b} can be any value in the set of real 14 | numbers. It should be strictly bigger than \code{a}, but if is not, the 15 | order of the parameters is inverted. Defaults to \code{1}.} 16 | } 17 | \value{ 18 | A \code{Uniform} object. 19 | } 20 | \description{ 21 | A distribution with constant density on an interval. The 22 | continuous analogue to the \code{\link[=Categorical]{Categorical()}} distribution. 23 | } 24 | \examples{ 25 | 26 | set.seed(27) 27 | 28 | X <- Uniform(1, 2) 29 | X 30 | 31 | random(X, 10) 32 | 33 | pdf(X, 0.7) 34 | log_pdf(X, 0.7) 35 | 36 | cdf(X, 0.7) 37 | quantile(X, 0.7) 38 | 39 | cdf(X, quantile(X, 0.7)) 40 | quantile(X, cdf(X, 0.7)) 41 | } 42 | \seealso{ 43 | Other continuous distributions: 44 | \code{\link{Beta}()}, 45 | \code{\link{Cauchy}()}, 46 | \code{\link{ChiSquare}()}, 47 | \code{\link{Erlang}()}, 48 | \code{\link{Exponential}()}, 49 | \code{\link{FisherF}()}, 50 | \code{\link{Frechet}()}, 51 | \code{\link{GEV}()}, 52 | \code{\link{GP}()}, 53 | \code{\link{Gamma}()}, 54 | \code{\link{Gumbel}()}, 55 | \code{\link{LogNormal}()}, 56 | \code{\link{Logistic}()}, 57 | \code{\link{Normal}()}, 58 | \code{\link{RevWeibull}()}, 59 | \code{\link{StudentsT}()}, 60 | \code{\link{Tukey}()}, 61 | \code{\link{Weibull}()} 62 | } 63 | \concept{continuous distributions} 64 | -------------------------------------------------------------------------------- /man/cdf.Bernoulli.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Bernoulli.R 3 | \name{cdf.Bernoulli} 4 | \alias{cdf.Bernoulli} 5 | \title{Evaluate the cumulative distribution function of a Bernoulli distribution} 6 | \usage{ 7 | \method{cdf}{Bernoulli}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Bernoulli} object created by a call to \code{\link[=Bernoulli]{Bernoulli()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{pbinom}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a Bernoulli distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Bernoulli(0.7) 42 | X 43 | 44 | mean(X) 45 | variance(X) 46 | skewness(X) 47 | kurtosis(X) 48 | 49 | random(X, 10) 50 | pdf(X, 1) 51 | log_pdf(X, 1) 52 | cdf(X, 0) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 0.7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/cdf.Beta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Beta.R 3 | \name{cdf.Beta} 4 | \alias{cdf.Beta} 5 | \title{Evaluate the cumulative distribution function of a Beta distribution} 6 | \usage{ 7 | \method{cdf}{Beta}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Beta} object created by a call to \code{\link[=Beta]{Beta()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{pbeta}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a Beta distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Beta(1, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | mean(X) 53 | variance(X) 54 | skewness(X) 55 | kurtosis(X) 56 | 57 | cdf(X, quantile(X, 0.7)) 58 | quantile(X, cdf(X, 0.7)) 59 | } 60 | -------------------------------------------------------------------------------- /man/cdf.Binomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Binomial.R 3 | \name{cdf.Binomial} 4 | \alias{cdf.Binomial} 5 | \title{Evaluate the cumulative distribution function of a Binomial distribution} 6 | \usage{ 7 | \method{cdf}{Binomial}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Binomial} object created by a call to \code{\link[=Binomial]{Binomial()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{pbinom}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a Binomial distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Binomial(10, 0.2) 42 | X 43 | 44 | mean(X) 45 | variance(X) 46 | skewness(X) 47 | kurtosis(X) 48 | 49 | random(X, 10) 50 | 51 | pdf(X, 2L) 52 | log_pdf(X, 2L) 53 | 54 | cdf(X, 4L) 55 | quantile(X, 0.7) 56 | 57 | cdf(X, quantile(X, 0.7)) 58 | quantile(X, cdf(X, 7)) 59 | } 60 | -------------------------------------------------------------------------------- /man/cdf.Categorical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Categorical.R 3 | \name{cdf.Categorical} 4 | \alias{cdf.Categorical} 5 | \title{Evaluate the cumulative distribution function of a Categorical distribution} 6 | \usage{ 7 | \method{cdf}{Categorical}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Categorical} object created by a call to \code{\link[=Categorical]{Categorical()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{...}{Unused. Unevaluated arguments will generate a warning to 16 | catch mispellings or other possible errors.} 17 | } 18 | \value{ 19 | A vector of probabilities, one for each element of \code{x}. 20 | } 21 | \description{ 22 | Evaluate the cumulative distribution function of a Categorical distribution 23 | } 24 | \examples{ 25 | 26 | set.seed(27) 27 | 28 | X <- Categorical(1:3, p = c(0.4, 0.1, 0.5)) 29 | X 30 | 31 | Y <- Categorical(LETTERS[1:4]) 32 | Y 33 | 34 | random(X, 10) 35 | random(Y, 10) 36 | 37 | pdf(X, 1) 38 | log_pdf(X, 1) 39 | 40 | cdf(X, 1) 41 | quantile(X, 0.5) 42 | 43 | # cdfs are only defined for numeric sample spaces. this errors! 44 | # cdf(Y, "a") 45 | 46 | # same for quantiles. this also errors! 47 | # quantile(Y, 0.7) 48 | } 49 | -------------------------------------------------------------------------------- /man/cdf.Cauchy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Cauchy.R 3 | \name{cdf.Cauchy} 4 | \alias{cdf.Cauchy} 5 | \title{Evaluate the cumulative distribution function of a Cauchy distribution} 6 | \usage{ 7 | \method{cdf}{Cauchy}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Cauchy} object created by a call to \code{\link[=Cauchy]{Cauchy()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{pcauchy}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a Cauchy distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Cauchy(10, 0.2) 42 | X 43 | 44 | mean(X) 45 | variance(X) 46 | skewness(X) 47 | kurtosis(X) 48 | 49 | random(X, 10) 50 | 51 | pdf(X, 2) 52 | log_pdf(X, 2) 53 | 54 | cdf(X, 2) 55 | quantile(X, 0.7) 56 | 57 | cdf(X, quantile(X, 0.7)) 58 | quantile(X, cdf(X, 7)) 59 | } 60 | -------------------------------------------------------------------------------- /man/cdf.ChiSquare.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ChiSquare.R 3 | \name{cdf.ChiSquare} 4 | \alias{cdf.ChiSquare} 5 | \title{Evaluate the cumulative distribution function of a chi square distribution} 6 | \usage{ 7 | \method{cdf}{ChiSquare}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{ChiSquare} object created by a call to \code{\link[=ChiSquare]{ChiSquare()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{pchisq}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a chi square distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- ChiSquare(5) 42 | X 43 | 44 | mean(X) 45 | variance(X) 46 | skewness(X) 47 | kurtosis(X) 48 | 49 | random(X, 10) 50 | 51 | pdf(X, 2) 52 | log_pdf(X, 2) 53 | 54 | cdf(X, 4) 55 | quantile(X, 0.7) 56 | 57 | cdf(X, quantile(X, 0.7)) 58 | quantile(X, cdf(X, 7)) 59 | } 60 | -------------------------------------------------------------------------------- /man/cdf.Erlang.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Erlang.R 3 | \name{cdf.Erlang} 4 | \alias{cdf.Erlang} 5 | \title{Evaluate the cumulative distribution function of an Erlang distribution} 6 | \usage{ 7 | \method{cdf}{Erlang}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Erlang} object created by a call to \code{\link[=Erlang]{Erlang()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{pgamma}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of an Erlang distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Erlang(5, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/cdf.FisherF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/FisherF.R 3 | \name{cdf.FisherF} 4 | \alias{cdf.FisherF} 5 | \title{Evaluate the cumulative distribution function of an F distribution} 6 | \usage{ 7 | \method{cdf}{FisherF}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{FisherF} object created by a call to \code{\link[=FisherF]{FisherF()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{pf}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of an F distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- FisherF(5, 10, 0.2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/cdf.Frechet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Frechet.R 3 | \name{cdf.Frechet} 4 | \alias{cdf.Frechet} 5 | \title{Evaluate the cumulative distribution function of a Frechet distribution} 6 | \usage{ 7 | \method{cdf}{Frechet}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Frechet} object created by a call to \code{\link[=Frechet]{Frechet()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{pgev}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a Frechet distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Frechet(0, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/cdf.GEV.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedExtremeValue.R 3 | \name{cdf.GEV} 4 | \alias{cdf.GEV} 5 | \title{Evaluate the cumulative distribution function of a GEV distribution} 6 | \usage{ 7 | \method{cdf}{GEV}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{GEV} object created by a call to \code{\link[=GEV]{GEV()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{pgev}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a GEV distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- GEV(1, 2, 0.1) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/cdf.GP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedPareto.R 3 | \name{cdf.GP} 4 | \alias{cdf.GP} 5 | \title{Evaluate the cumulative distribution function of a GP distribution} 6 | \usage{ 7 | \method{cdf}{GP}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{GP} object created by a call to \code{\link[=GP]{GP()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{pgp}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a GP distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- GP(0, 2, 0.1) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/cdf.Gamma.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gamma.R 3 | \name{cdf.Gamma} 4 | \alias{cdf.Gamma} 5 | \title{Evaluate the cumulative distribution function of a Gamma distribution} 6 | \usage{ 7 | \method{cdf}{Gamma}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Gamma} object created by a call to \code{\link[=Gamma]{Gamma()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{pgamma}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a Gamma distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Gamma(5, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/cdf.Gumbel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gumbel.R 3 | \name{cdf.Gumbel} 4 | \alias{cdf.Gumbel} 5 | \title{Evaluate the cumulative distribution function of a Gumbel distribution} 6 | \usage{ 7 | \method{cdf}{Gumbel}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Gumbel} object created by a call to \code{\link[=Gumbel]{Gumbel()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{pgev}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a Gumbel distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Gumbel(1, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/cdf.Poisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Poisson.R 3 | \name{cdf.Poisson} 4 | \alias{cdf.Poisson} 5 | \title{Evaluate the cumulative distribution function of a Poisson distribution} 6 | \usage{ 7 | \method{cdf}{Poisson}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Poisson} object created by a call to \code{\link[=Poisson]{Poisson()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{ppois}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a Poisson distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Poisson(2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/cdf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/methods.R 3 | \name{cdf} 4 | \alias{cdf} 5 | \title{Evaluate the cumulative distribution function of a probability distribution} 6 | \usage{ 7 | cdf(d, x, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An object. The package provides methods for distribution 11 | objects such as those from \code{\link[=Normal]{Normal()}} or \code{\link[=Binomial]{Binomial()}} etc.} 12 | 13 | \item{x}{A vector of elements whose cumulative probabilities you would 14 | like to determine given the distribution \code{d}.} 15 | 16 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 17 | 18 | \item{...}{Arguments passed to methods. Unevaluated arguments will generate a warning to 19 | catch mispellings or other possible errors.} 20 | } 21 | \value{ 22 | Probabilities corresponding to the vector \code{x}. 23 | } 24 | \description{ 25 | Generic function for computing probabilities from distribution objects based 26 | on the cumulative distribution function (CDF). 27 | } 28 | \examples{ 29 | ## distribution object 30 | X <- Normal() 31 | ## probabilities from CDF 32 | cdf(X, c(1, 2, 3, 4, 5)) 33 | } 34 | -------------------------------------------------------------------------------- /man/cdf.RevWeibull.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ReversedWeibull.R 3 | \name{cdf.RevWeibull} 4 | \alias{cdf.RevWeibull} 5 | \title{Evaluate the cumulative distribution function of an RevWeibull distribution} 6 | \usage{ 7 | \method{cdf}{RevWeibull}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{RevWeibull} object created by a call to \code{\link[=RevWeibull]{RevWeibull()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{pgev}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of an RevWeibull distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- RevWeibull(1, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/cdf.Tukey.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Tukey.R 3 | \name{cdf.Tukey} 4 | \alias{cdf.Tukey} 5 | \title{Evaluate the cumulative distribution function of a Tukey distribution} 6 | \usage{ 7 | \method{cdf}{Tukey}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Tukey} distribution created by a call to \code{\link[=Tukey]{Tukey()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{ptukey}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a Tukey distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Tukey(4L, 16L, 2L) 42 | X 43 | 44 | cdf(X, 4) 45 | quantile(X, 0.7) 46 | } 47 | \seealso{ 48 | Other Tukey distribution: 49 | \code{\link{quantile.Tukey}()} 50 | } 51 | \concept{Tukey distribution} 52 | -------------------------------------------------------------------------------- /man/cdf.Uniform.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Uniform.R 3 | \name{cdf.Uniform} 4 | \alias{cdf.Uniform} 5 | \title{Evaluate the cumulative distribution function of a continuous Uniform distribution} 6 | \usage{ 7 | \method{cdf}{Uniform}(d, x, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Uniform} object created by a call to \code{\link[=Uniform]{Uniform()}}.} 11 | 12 | \item{x}{A vector of elements whose cumulative probabilities you would 13 | like to determine given the distribution \code{d}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 18 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{punif}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 32 | object, a matrix with \code{length(x)} columns containing all possible combinations. 33 | } 34 | \description{ 35 | Evaluate the cumulative distribution function of a continuous Uniform distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Uniform(1, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/distributions3-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/distributions3-package.R 3 | \docType{package} 4 | \name{distributions3-package} 5 | \alias{distributions3} 6 | \alias{distributions3-package} 7 | \title{distributions3: Probability Distributions as S3 Objects} 8 | \description{ 9 | Tools to create and manipulate probability distributions using S3. Generics pdf(), cdf(), quantile(), and random() provide replacements for base R's d/p/q/r style functions. Functions and arguments have been named carefully to minimize confusion for students in intro stats courses. The documentation for each distribution contains detailed mathematical notes. 10 | } 11 | \seealso{ 12 | Useful links: 13 | \itemize{ 14 | \item \url{https://github.com/alexpghayes/distributions3} 15 | \item \url{https://alexpghayes.github.io/distributions3/} 16 | \item Report bugs at \url{https://github.com/alexpghayes/distributions3/issues} 17 | } 18 | 19 | } 20 | \author{ 21 | \strong{Maintainer}: Alex Hayes \email{alexpghayes@gmail.com} (\href{https://orcid.org/0000-0002-4985-5160}{ORCID}) 22 | 23 | Authors: 24 | \itemize{ 25 | \item Ralph Moller-Trane 26 | \item Daniel Jordan \email{dandermotj@gmail.com} 27 | \item Paul Northrop \email{p.northrop@ucl.ac.uk} 28 | \item Moritz N. Lang \email{moritz.n.lang@gmail.com} (\href{https://orcid.org/0000-0002-2533-9903}{ORCID}) 29 | \item Achim Zeileis \email{Achim.Zeileis@R-project.org} (\href{https://orcid.org/0000-0003-0918-3766}{ORCID}) 30 | } 31 | 32 | Other contributors: 33 | \itemize{ 34 | \item Emil Hvitfeldt \email{emilhhvitfeldt@gmail.com} (\href{https://orcid.org/0000-0002-0679-1945}{ORCID}) [contributor] 35 | \item Bruna Wundervald \email{brunadaviesw@gmail.com} [contributor] 36 | \item Alessandro Gasparini \email{alessandro.gasparini@ki.se} [contributor] 37 | } 38 | 39 | } 40 | \keyword{internal} 41 | -------------------------------------------------------------------------------- /man/fit_mle.Bernoulli.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Bernoulli.R 3 | \name{fit_mle.Bernoulli} 4 | \alias{fit_mle.Bernoulli} 5 | \title{Fit a Bernoulli distribution to data} 6 | \usage{ 7 | \method{fit_mle}{Bernoulli}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Bernoulli} object.} 11 | 12 | \item{x}{A vector of zeroes and ones.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | a \code{Bernoulli} object 18 | } 19 | \description{ 20 | Fit a Bernoulli distribution to data 21 | } 22 | -------------------------------------------------------------------------------- /man/fit_mle.Binomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Binomial.R 3 | \name{fit_mle.Binomial} 4 | \alias{fit_mle.Binomial} 5 | \title{Fit a Binomial distribution to data} 6 | \usage{ 7 | \method{fit_mle}{Binomial}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Binomial} object.} 11 | 12 | \item{x}{A vector of zeroes and ones.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | a \code{Binomial} object 18 | } 19 | \description{ 20 | The fit distribution will inherit the same \code{size} parameter as 21 | the \code{Binomial} object passed. 22 | } 23 | -------------------------------------------------------------------------------- /man/fit_mle.Exponential.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Exponential.R 3 | \name{fit_mle.Exponential} 4 | \alias{fit_mle.Exponential} 5 | \title{Fit an Exponential distribution to data} 6 | \usage{ 7 | \method{fit_mle}{Exponential}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Exponential} object created by a call to \code{\link[=Exponential]{Exponential()}}.} 11 | 12 | \item{x}{A vector of data.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | An \code{Exponential} object. 18 | } 19 | \description{ 20 | Fit an Exponential distribution to data 21 | } 22 | \concept{Exponential distribution} 23 | -------------------------------------------------------------------------------- /man/fit_mle.Gamma.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gamma.R 3 | \name{fit_mle.Gamma} 4 | \alias{fit_mle.Gamma} 5 | \title{Fit a Gamma distribution to data} 6 | \usage{ 7 | \method{fit_mle}{Gamma}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Gamma} object created by a call to \code{\link[=Gamma]{Gamma()}}.} 11 | 12 | \item{x}{A vector to fit the Gamma distribution to.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | a \code{Gamma} object 18 | } 19 | \description{ 20 | Fit a Gamma distribution to data 21 | } 22 | -------------------------------------------------------------------------------- /man/fit_mle.Geometric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Geometric.R 3 | \name{fit_mle.Geometric} 4 | \alias{fit_mle.Geometric} 5 | \title{Fit a Geometric distribution to data} 6 | \usage{ 7 | \method{fit_mle}{Geometric}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Geometric} object.} 11 | 12 | \item{x}{A vector of zeroes and ones.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | a \code{Geometric} object 18 | } 19 | \description{ 20 | Fit a Geometric distribution to data 21 | } 22 | -------------------------------------------------------------------------------- /man/fit_mle.LogNormal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/LogNormal.R 3 | \name{fit_mle.LogNormal} 4 | \alias{fit_mle.LogNormal} 5 | \title{Fit a Log Normal distribution to data} 6 | \usage{ 7 | \method{fit_mle}{LogNormal}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{LogNormal} object created by a call to \code{\link[=LogNormal]{LogNormal()}}.} 11 | 12 | \item{x}{A vector of data.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | A \code{LogNormal} object. 18 | } 19 | \description{ 20 | Fit a Log Normal distribution to data 21 | } 22 | \seealso{ 23 | Other LogNormal distribution: 24 | \code{\link{cdf.LogNormal}()}, 25 | \code{\link{pdf.LogNormal}()}, 26 | \code{\link{quantile.LogNormal}()}, 27 | \code{\link{random.LogNormal}()} 28 | } 29 | \concept{LogNormal distribution} 30 | -------------------------------------------------------------------------------- /man/fit_mle.Normal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Normal.R 3 | \name{fit_mle.Normal} 4 | \alias{fit_mle.Normal} 5 | \title{Fit a Normal distribution to data} 6 | \usage{ 7 | \method{fit_mle}{Normal}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Normal} object created by a call to \code{\link[=Normal]{Normal()}}.} 11 | 12 | \item{x}{A vector of data.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | A \code{Normal} object. 18 | } 19 | \description{ 20 | Fit a Normal distribution to data 21 | } 22 | \seealso{ 23 | Other Normal distribution: 24 | \code{\link{cdf.Normal}()}, 25 | \code{\link{pdf.Normal}()}, 26 | \code{\link{quantile.Normal}()} 27 | } 28 | \concept{Normal distribution} 29 | -------------------------------------------------------------------------------- /man/fit_mle.Poisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Poisson.R 3 | \name{fit_mle.Poisson} 4 | \alias{fit_mle.Poisson} 5 | \title{Fit an Poisson distribution to data} 6 | \usage{ 7 | \method{fit_mle}{Poisson}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Poisson} object created by a call to \code{\link[=Poisson]{Poisson()}}.} 11 | 12 | \item{x}{A vector of data.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | An \code{Poisson} object. 18 | } 19 | \description{ 20 | Fit an Poisson distribution to data 21 | } 22 | \concept{Poisson distribution} 23 | -------------------------------------------------------------------------------- /man/fit_mle.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/methods.R 3 | \name{fit_mle} 4 | \alias{fit_mle} 5 | \title{Fit a distribution to data} 6 | \usage{ 7 | fit_mle(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An object. The package provides methods for distribution 11 | objects such as those from \code{\link[=Normal]{Normal()}} or \code{\link[=Binomial]{Binomial()}} etc.} 12 | 13 | \item{x}{A vector of data to compute the likelihood.} 14 | 15 | \item{...}{Arguments passed to methods. Unevaluated arguments will generate a warning to 16 | catch mispellings or other possible errors.} 17 | } 18 | \value{ 19 | A distribution (the same kind as \code{d}) where the parameters 20 | are the MLE estimates based on \code{x}. 21 | } 22 | \description{ 23 | Generic function for fitting maximum-likelihood estimates (MLEs) of 24 | a distribution based on empirical data. 25 | } 26 | \examples{ 27 | X <- Normal() 28 | fit_mle(X, c(-1, 0, 0, 0, 3)) 29 | } 30 | -------------------------------------------------------------------------------- /man/is_discrete.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/is_discrete.R 3 | \name{is_discrete} 4 | \alias{is_discrete} 5 | \alias{is_continuous} 6 | \title{Determine whether a distribution is discrete or continuous} 7 | \usage{ 8 | is_discrete(d, ...) 9 | 10 | is_continuous(d, ...) 11 | } 12 | \arguments{ 13 | \item{d}{An object. The package provides methods for distribution 14 | objects such as those from \code{\link[=Normal]{Normal()}} or \code{\link[=Binomial]{Binomial()}} etc.} 15 | 16 | \item{...}{Arguments passed to methods. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | A logical vector indicating whether the distribution(s) in \code{d} 21 | is/are discrete or continuous, respectively. 22 | } 23 | \description{ 24 | Generic functions for determining whether a certain probability distribution 25 | is discrete or continuous, respectively. 26 | } 27 | \details{ 28 | The generic function \code{is_discrete} is intended to return \code{TRUE} 29 | for every distribution whose entire support is discrete and \code{FALSE} 30 | otherwise. Analogously, \code{is_continuous} is intended to return \code{TRUE} 31 | for every distribution whose entire support is continuous and \code{FALSE} 32 | otherwise. For mixed discrete-continuous distributions both methods should 33 | return \code{FALSE}. 34 | 35 | Methods for both generics are provided for all \code{distribution} classes 36 | set up in this package. 37 | } 38 | \examples{ 39 | X <- Normal() 40 | is_discrete(X) 41 | is_continuous(X) 42 | Y <- Binomial(size = 10, p = c(0.2, 0.5, 0.8)) 43 | is_discrete(Y) 44 | is_continuous(Y) 45 | } 46 | -------------------------------------------------------------------------------- /man/is_distribution.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{is_distribution} 4 | \alias{is_distribution} 5 | \title{Is an object a distribution?} 6 | \usage{ 7 | is_distribution(x) 8 | } 9 | \arguments{ 10 | \item{x}{An object to test.} 11 | } 12 | \description{ 13 | \code{is_distribution} tests if \code{x} inherits from \code{"distribution"}. 14 | } 15 | \examples{ 16 | 17 | Z <- Normal() 18 | 19 | is_distribution(Z) 20 | is_distribution(1L) 21 | } 22 | -------------------------------------------------------------------------------- /man/log_likelihood.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/methods.R 3 | \name{log_likelihood} 4 | \alias{log_likelihood} 5 | \alias{likelihood} 6 | \title{Compute the (log-)likelihood of a probability distribution given data} 7 | \usage{ 8 | log_likelihood(d, x, ...) 9 | 10 | likelihood(d, x, ...) 11 | } 12 | \arguments{ 13 | \item{d}{An object. The package provides methods for distribution 14 | objects such as those from \code{\link[=Normal]{Normal()}} or \code{\link[=Binomial]{Binomial()}} etc.} 15 | 16 | \item{x}{A vector of data to compute the likelihood.} 17 | 18 | \item{...}{Arguments passed to methods. Unevaluated arguments will generate a warning to 19 | catch mispellings or other possible errors.} 20 | } 21 | \value{ 22 | Numeric value of the (log-)likelihood. 23 | } 24 | \description{ 25 | Functions for computing the (log-)likelihood based on a distribution 26 | object and observed data. The log-likelihood is computed as the sum of 27 | log-density contributions and the likelihood by taking the exponential thereof. 28 | } 29 | \examples{ 30 | ## distribution object 31 | X <- Normal() 32 | ## sum of log_pdf() contributions 33 | log_likelihood(X, c(-1, 0, 0, 0, 3)) 34 | ## exp of log_likelihood() 35 | likelihood(X, c(-1, 0, 0, 0, 3)) 36 | } 37 | -------------------------------------------------------------------------------- /man/pdf.Categorical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Categorical.R 3 | \name{pdf.Categorical} 4 | \alias{pdf.Categorical} 5 | \alias{log_pdf.Categorical} 6 | \title{Evaluate the probability mass function of a Categorical discrete distribution} 7 | \usage{ 8 | \method{pdf}{Categorical}(d, x, ...) 9 | 10 | \method{log_pdf}{Categorical}(d, x, ...) 11 | } 12 | \arguments{ 13 | \item{d}{A \code{Categorical} object created by a call to \code{\link[=Categorical]{Categorical()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{...}{Unused. Unevaluated arguments will generate a warning to 19 | catch mispellings or other possible errors.} 20 | } 21 | \value{ 22 | A vector of probabilities, one for each element of \code{x}. 23 | } 24 | \description{ 25 | Evaluate the probability mass function of a Categorical discrete distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Categorical(1:3, p = c(0.4, 0.1, 0.5)) 32 | X 33 | 34 | Y <- Categorical(LETTERS[1:4]) 35 | Y 36 | 37 | random(X, 10) 38 | random(Y, 10) 39 | 40 | pdf(X, 1) 41 | log_pdf(X, 1) 42 | 43 | cdf(X, 1) 44 | quantile(X, 0.5) 45 | 46 | # cdfs are only defined for numeric sample spaces. this errors! 47 | # cdf(Y, "a") 48 | 49 | # same for quantiles. this also errors! 50 | # quantile(Y, 0.7) 51 | } 52 | -------------------------------------------------------------------------------- /man/pdf.Erlang.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Erlang.R 3 | \name{pdf.Erlang} 4 | \alias{pdf.Erlang} 5 | \alias{log_pdf.Erlang} 6 | \title{Evaluate the probability mass function of an Erlang distribution} 7 | \usage{ 8 | \method{pdf}{Erlang}(d, x, drop = TRUE, elementwise = NULL, ...) 9 | 10 | \method{log_pdf}{Erlang}(d, x, drop = TRUE, elementwise = NULL, ...) 11 | } 12 | \arguments{ 13 | \item{d}{An \code{Erlang} object created by a call to \code{\link[=Erlang]{Erlang()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 19 | 20 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 21 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 22 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 23 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 24 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 25 | lengths match and otherwise \code{elementwise = FALSE} is used.} 26 | 27 | \item{...}{Arguments to be passed to \code{\link[stats]{dgamma}}. 28 | Unevaluated arguments will generate a warning to catch mispellings or other 29 | possible errors.} 30 | } 31 | \value{ 32 | In case of a single distribution object, either a numeric 33 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 34 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 35 | object, a matrix with \code{length(x)} columns containing all possible combinations. 36 | } 37 | \description{ 38 | Evaluate the probability mass function of an Erlang distribution 39 | } 40 | \examples{ 41 | 42 | set.seed(27) 43 | 44 | X <- Erlang(5, 2) 45 | X 46 | 47 | random(X, 10) 48 | 49 | pdf(X, 2) 50 | log_pdf(X, 2) 51 | 52 | cdf(X, 4) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/pdf.FisherF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/FisherF.R 3 | \name{pdf.FisherF} 4 | \alias{pdf.FisherF} 5 | \alias{log_pdf.FisherF} 6 | \title{Evaluate the probability mass function of an F distribution} 7 | \usage{ 8 | \method{pdf}{FisherF}(d, x, drop = TRUE, elementwise = NULL, ...) 9 | 10 | \method{log_pdf}{FisherF}(d, x, drop = TRUE, elementwise = NULL, ...) 11 | } 12 | \arguments{ 13 | \item{d}{A \code{FisherF} object created by a call to \code{\link[=FisherF]{FisherF()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 19 | 20 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 21 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 22 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 23 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 24 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 25 | lengths match and otherwise \code{elementwise = FALSE} is used.} 26 | 27 | \item{...}{Arguments to be passed to \code{\link[stats]{df}}. 28 | Unevaluated arguments will generate a warning to catch mispellings or other 29 | possible errors.} 30 | } 31 | \value{ 32 | In case of a single distribution object, either a numeric 33 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 34 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 35 | object, a matrix with \code{length(x)} columns containing all possible combinations. 36 | } 37 | \description{ 38 | Evaluate the probability mass function of an F distribution 39 | } 40 | \examples{ 41 | 42 | set.seed(27) 43 | 44 | X <- FisherF(5, 10, 0.2) 45 | X 46 | 47 | random(X, 10) 48 | 49 | pdf(X, 2) 50 | log_pdf(X, 2) 51 | 52 | cdf(X, 4) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/pdf.Frechet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Frechet.R 3 | \name{pdf.Frechet} 4 | \alias{pdf.Frechet} 5 | \alias{log_pdf.Frechet} 6 | \title{Evaluate the probability mass function of a Frechet distribution} 7 | \usage{ 8 | \method{pdf}{Frechet}(d, x, drop = TRUE, elementwise = NULL, ...) 9 | 10 | \method{log_pdf}{Frechet}(d, x, drop = TRUE, elementwise = NULL, ...) 11 | } 12 | \arguments{ 13 | \item{d}{A \code{Frechet} object created by a call to \code{\link[=Frechet]{Frechet()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 19 | 20 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 21 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 22 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 23 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 24 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 25 | lengths match and otherwise \code{elementwise = FALSE} is used.} 26 | 27 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{dgev}}. 28 | Unevaluated arguments will generate a warning to catch mispellings or other 29 | possible errors.} 30 | } 31 | \value{ 32 | In case of a single distribution object, either a numeric 33 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 34 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 35 | object, a matrix with \code{length(x)} columns containing all possible combinations. 36 | } 37 | \description{ 38 | Evaluate the probability mass function of a Frechet distribution 39 | } 40 | \examples{ 41 | 42 | set.seed(27) 43 | 44 | X <- Frechet(0, 2) 45 | X 46 | 47 | random(X, 10) 48 | 49 | pdf(X, 0.7) 50 | log_pdf(X, 0.7) 51 | 52 | cdf(X, 0.7) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 0.7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/pdf.GEV.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedExtremeValue.R 3 | \name{pdf.GEV} 4 | \alias{pdf.GEV} 5 | \alias{log_pdf.GEV} 6 | \title{Evaluate the probability mass function of a GEV distribution} 7 | \usage{ 8 | \method{pdf}{GEV}(d, x, drop = TRUE, elementwise = NULL, ...) 9 | 10 | \method{log_pdf}{GEV}(d, x, drop = TRUE, elementwise = NULL, ...) 11 | } 12 | \arguments{ 13 | \item{d}{A \code{GEV} object created by a call to \code{\link[=GEV]{GEV()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 19 | 20 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 21 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 22 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 23 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 24 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 25 | lengths match and otherwise \code{elementwise = FALSE} is used.} 26 | 27 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{dgev}}. 28 | Unevaluated arguments will generate a warning to catch mispellings or other 29 | possible errors.} 30 | } 31 | \value{ 32 | In case of a single distribution object, either a numeric 33 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 34 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 35 | object, a matrix with \code{length(x)} columns containing all possible combinations. 36 | } 37 | \description{ 38 | Evaluate the probability mass function of a GEV distribution 39 | } 40 | \examples{ 41 | 42 | set.seed(27) 43 | 44 | X <- GEV(1, 2, 0.1) 45 | X 46 | 47 | random(X, 10) 48 | 49 | pdf(X, 0.7) 50 | log_pdf(X, 0.7) 51 | 52 | cdf(X, 0.7) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 0.7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/pdf.GP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedPareto.R 3 | \name{pdf.GP} 4 | \alias{pdf.GP} 5 | \alias{log_pdf.GP} 6 | \title{Evaluate the probability mass function of a GP distribution} 7 | \usage{ 8 | \method{pdf}{GP}(d, x, drop = TRUE, elementwise = NULL, ...) 9 | 10 | \method{log_pdf}{GP}(d, x, drop = TRUE, elementwise = NULL, ...) 11 | } 12 | \arguments{ 13 | \item{d}{A \code{GP} object created by a call to \code{\link[=GP]{GP()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 19 | 20 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 21 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 22 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 23 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 24 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 25 | lengths match and otherwise \code{elementwise = FALSE} is used.} 26 | 27 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{dgp}}. 28 | Unevaluated arguments will generate a warning to catch mispellings or other 29 | possible errors.} 30 | } 31 | \value{ 32 | In case of a single distribution object, either a numeric 33 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 34 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 35 | object, a matrix with \code{length(x)} columns containing all possible combinations. 36 | } 37 | \description{ 38 | Evaluate the probability mass function of a GP distribution 39 | } 40 | \examples{ 41 | 42 | set.seed(27) 43 | 44 | X <- GP(0, 2, 0.1) 45 | X 46 | 47 | random(X, 10) 48 | 49 | pdf(X, 0.7) 50 | log_pdf(X, 0.7) 51 | 52 | cdf(X, 0.7) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 0.7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/pdf.Gamma.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gamma.R 3 | \name{pdf.Gamma} 4 | \alias{pdf.Gamma} 5 | \alias{log_pdf.Gamma} 6 | \title{Evaluate the probability mass function of a Gamma distribution} 7 | \usage{ 8 | \method{pdf}{Gamma}(d, x, drop = TRUE, elementwise = NULL, ...) 9 | 10 | \method{log_pdf}{Gamma}(d, x, drop = TRUE, elementwise = NULL, ...) 11 | } 12 | \arguments{ 13 | \item{d}{A \code{Gamma} object created by a call to \code{\link[=Gamma]{Gamma()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 19 | 20 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 21 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 22 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 23 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 24 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 25 | lengths match and otherwise \code{elementwise = FALSE} is used.} 26 | 27 | \item{...}{Arguments to be passed to \code{\link[stats]{dgamma}}. 28 | Unevaluated arguments will generate a warning to catch mispellings or other 29 | possible errors.} 30 | } 31 | \value{ 32 | In case of a single distribution object, either a numeric 33 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 34 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 35 | object, a matrix with \code{length(x)} columns containing all possible combinations. 36 | } 37 | \description{ 38 | Evaluate the probability mass function of a Gamma distribution 39 | } 40 | \examples{ 41 | 42 | set.seed(27) 43 | 44 | X <- Gamma(5, 2) 45 | X 46 | 47 | random(X, 10) 48 | 49 | pdf(X, 2) 50 | log_pdf(X, 2) 51 | 52 | cdf(X, 4) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/pdf.Gumbel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gumbel.R 3 | \name{pdf.Gumbel} 4 | \alias{pdf.Gumbel} 5 | \alias{log_pdf.Gumbel} 6 | \title{Evaluate the probability mass function of a Gumbel distribution} 7 | \usage{ 8 | \method{pdf}{Gumbel}(d, x, drop = TRUE, elementwise = NULL, ...) 9 | 10 | \method{log_pdf}{Gumbel}(d, x, drop = TRUE, elementwise = NULL, ...) 11 | } 12 | \arguments{ 13 | \item{d}{A \code{Gumbel} object created by a call to \code{\link[=Gumbel]{Gumbel()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 19 | 20 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 21 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 22 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 23 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 24 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 25 | lengths match and otherwise \code{elementwise = FALSE} is used.} 26 | 27 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{dgev}}. 28 | Unevaluated arguments will generate a warning to catch mispellings or other 29 | possible errors.} 30 | } 31 | \value{ 32 | In case of a single distribution object, either a numeric 33 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 34 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 35 | object, a matrix with \code{length(x)} columns containing all possible combinations. 36 | } 37 | \description{ 38 | Evaluate the probability mass function of a Gumbel distribution 39 | } 40 | \examples{ 41 | 42 | set.seed(27) 43 | 44 | X <- Gumbel(1, 2) 45 | X 46 | 47 | random(X, 10) 48 | 49 | pdf(X, 0.7) 50 | log_pdf(X, 0.7) 51 | 52 | cdf(X, 0.7) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 0.7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/pdf.Multinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Multinomial.R 3 | \name{pdf.Multinomial} 4 | \alias{pdf.Multinomial} 5 | \alias{log_pdf.Multinomial} 6 | \title{Evaluate the probability mass function of a Multinomial distribution} 7 | \usage{ 8 | \method{pdf}{Multinomial}(d, x, ...) 9 | 10 | \method{log_pdf}{Multinomial}(d, x, ...) 11 | } 12 | \arguments{ 13 | \item{d}{A \code{Multinomial} object created by a call to \code{\link[=Multinomial]{Multinomial()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{...}{Unused. Unevaluated arguments will generate a warning to 19 | catch mispellings or other possible errors.} 20 | } 21 | \value{ 22 | A vector of probabilities, one for each element of \code{x}. 23 | } 24 | \description{ 25 | Please see the documentation of \code{\link[=Multinomial]{Multinomial()}} for some properties 26 | of the Multinomial distribution, as well as extensive examples 27 | showing to how calculate p-values and confidence intervals. 28 | } 29 | \examples{ 30 | 31 | set.seed(27) 32 | 33 | X <- Multinomial(size = 5, p = c(0.3, 0.4, 0.2, 0.1)) 34 | X 35 | 36 | random(X, 10) 37 | 38 | # pdf(X, 2) 39 | # log_pdf(X, 2) 40 | } 41 | \seealso{ 42 | Other Multinomial distribution: 43 | \code{\link{random.Multinomial}()} 44 | } 45 | \concept{Multinomial distribution} 46 | -------------------------------------------------------------------------------- /man/pdf.Poisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Poisson.R 3 | \name{pdf.Poisson} 4 | \alias{pdf.Poisson} 5 | \alias{log_pdf.Poisson} 6 | \title{Evaluate the probability mass function of a Poisson distribution} 7 | \usage{ 8 | \method{pdf}{Poisson}(d, x, drop = TRUE, elementwise = NULL, ...) 9 | 10 | \method{log_pdf}{Poisson}(d, x, drop = TRUE, elementwise = NULL, ...) 11 | } 12 | \arguments{ 13 | \item{d}{A \code{Poisson} object created by a call to \code{\link[=Poisson]{Poisson()}}.} 14 | 15 | \item{x}{A vector of elements whose probabilities you would like to 16 | determine given the distribution \code{d}.} 17 | 18 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 19 | 20 | \item{elementwise}{logical. Should each distribution in \code{d} be evaluated 21 | at all elements of \code{x} (\code{elementwise = FALSE}, yielding a matrix)? 22 | Or, if \code{d} and \code{x} have the same length, should the evaluation be 23 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 24 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 25 | lengths match and otherwise \code{elementwise = FALSE} is used.} 26 | 27 | \item{...}{Arguments to be passed to \code{\link[stats]{dpois}}. 28 | Unevaluated arguments will generate a warning to catch mispellings or other 29 | possible errors.} 30 | } 31 | \value{ 32 | In case of a single distribution object, either a numeric 33 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 34 | \code{length(x)} columns (if \code{drop = FALSE}). In case of a vectorized distribution 35 | object, a matrix with \code{length(x)} columns containing all possible combinations. 36 | } 37 | \description{ 38 | Evaluate the probability mass function of a Poisson distribution 39 | } 40 | \examples{ 41 | 42 | set.seed(27) 43 | 44 | X <- Poisson(2) 45 | X 46 | 47 | random(X, 10) 48 | 49 | pdf(X, 2) 50 | log_pdf(X, 2) 51 | 52 | cdf(X, 4) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/pdf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/methods.R 3 | \name{pdf} 4 | \alias{pdf} 5 | \alias{log_pdf} 6 | \alias{pmf} 7 | \title{Evaluate the probability density of a probability distribution} 8 | \usage{ 9 | pdf(d, x, drop = TRUE, ...) 10 | 11 | log_pdf(d, x, ...) 12 | 13 | pmf(d, x, ...) 14 | } 15 | \arguments{ 16 | \item{d}{An object. The package provides methods for distribution 17 | objects such as those from \code{\link[=Normal]{Normal()}} or \code{\link[=Binomial]{Binomial()}} etc.} 18 | 19 | \item{x}{A vector of elements whose probabilities you would like to 20 | determine given the distribution \code{d}.} 21 | 22 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 23 | 24 | \item{...}{Arguments passed to methods. Unevaluated arguments will generate a warning to 25 | catch mispellings or other possible errors.} 26 | } 27 | \value{ 28 | Probabilities corresponding to the vector \code{x}. 29 | } 30 | \description{ 31 | Generic function for computing probability density function (PDF) 32 | contributions based on a distribution object and observed data. 33 | } 34 | \details{ 35 | The generic function \code{pdf()} computes the probability density, 36 | both for continuous and discrete distributions. \code{pmf()} (for the 37 | probability mass function) is an alias that just calls \code{pdf()} internally. 38 | For computing log-density contributions (e.g., to a log-likelihood) 39 | either \code{pdf(..., log = TRUE)} can be used or the generic function 40 | \code{log_pdf()}. 41 | } 42 | \examples{ 43 | ## distribution object 44 | X <- Normal() 45 | ## probability density 46 | pdf(X, c(1, 2, 3, 4, 5)) 47 | pmf(X, c(1, 2, 3, 4, 5)) 48 | ## log-density 49 | pdf(X, c(1, 2, 3, 4, 5), log = TRUE) 50 | log_pdf(X, c(1, 2, 3, 4, 5)) 51 | } 52 | -------------------------------------------------------------------------------- /man/plot_cdf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{plot_cdf} 4 | \alias{plot_cdf} 5 | \title{Plot the CDF of a distribution} 6 | \usage{ 7 | plot_cdf(d, limits = NULL, p = 0.001, plot_theme = NULL) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{distribution} object} 11 | 12 | \item{limits}{either \code{NULL} (default) or a vector of length 2 that specifies the range of the x-axis} 13 | 14 | \item{p}{If \code{limits} is \code{NULL}, the range of the x-axis will be the support of \code{d} if this is a bounded 15 | interval, or \code{quantile(d, p)} and \code{quantile(d, 1 - p)} if lower and/or upper limits of the support is 16 | \code{-Inf}/\code{Inf}. Defaults to 0.001.} 17 | 18 | \item{plot_theme}{specify theme of resulting plot using \code{ggplot2}. Default is \code{theme_minimal}} 19 | } 20 | \description{ 21 | A function to easily plot the CDF of a distribution using \code{ggplot2}. Requires \code{ggplot2} to be loaded. 22 | } 23 | \examples{ 24 | 25 | N1 <- Normal() 26 | plot_cdf(N1) 27 | 28 | N2 <- Normal(0, c(1, 2)) 29 | plot_cdf(N2) 30 | 31 | B1 <- Binomial(10, 0.2) 32 | plot_cdf(B1) 33 | 34 | B2 <- Binomial(10, c(0.2, 0.5)) 35 | plot_cdf(B2) 36 | } 37 | -------------------------------------------------------------------------------- /man/plot_pdf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{plot_pdf} 4 | \alias{plot_pdf} 5 | \title{Plot the PDF of a distribution} 6 | \usage{ 7 | plot_pdf(d, limits = NULL, p = 0.001, plot_theme = NULL) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{distribution} object} 11 | 12 | \item{limits}{either \code{NULL} (default) or a vector of length 2 that specifies the range of the x-axis} 13 | 14 | \item{p}{If \code{limits} is \code{NULL}, the range of the x-axis will be the support of \code{d} if this is a bounded 15 | interval, or \code{quantile(d, p)} and \code{quantile(d, 1 - p)} if lower and/or upper limits of the support is 16 | \code{-Inf}/\code{Inf}. Defaults to 0.001.} 17 | 18 | \item{plot_theme}{specify theme of resulting plot using \code{ggplot2}. Default is \code{theme_minimal}} 19 | } 20 | \description{ 21 | A function to easily plot the PDF of a distribution using \code{ggplot2}. Requires \code{ggplot2} to be loaded. 22 | } 23 | \examples{ 24 | 25 | N1 <- Normal() 26 | plot_pdf(N1) 27 | 28 | N2 <- Normal(0, c(1, 2)) 29 | plot_pdf(N2) 30 | 31 | B1 <- Binomial(10, 0.2) 32 | plot_pdf(B1) 33 | 34 | B2 <- Binomial(10, c(0.2, 0.5)) 35 | plot_pdf(B2) 36 | } 37 | -------------------------------------------------------------------------------- /man/quantile.Bernoulli.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Bernoulli.R 3 | \name{quantile.Bernoulli} 4 | \alias{quantile.Bernoulli} 5 | \title{Determine quantiles of a Bernoulli distribution} 6 | \usage{ 7 | \method{quantile}{Bernoulli}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Bernoulli} object created by a call to \code{\link[=Bernoulli]{Bernoulli()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qbinom}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Bernoulli(0.7) 42 | X 43 | 44 | mean(X) 45 | variance(X) 46 | skewness(X) 47 | kurtosis(X) 48 | 49 | random(X, 10) 50 | pdf(X, 1) 51 | log_pdf(X, 1) 52 | cdf(X, 0) 53 | quantile(X, 0.7) 54 | 55 | cdf(X, quantile(X, 0.7)) 56 | quantile(X, cdf(X, 0.7)) 57 | } 58 | -------------------------------------------------------------------------------- /man/quantile.Beta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Beta.R 3 | \name{quantile.Beta} 4 | \alias{quantile.Beta} 5 | \title{Determine quantiles of a Beta distribution} 6 | \usage{ 7 | \method{quantile}{Beta}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Beta} object created by a call to \code{\link[=Beta]{Beta()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qbeta}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Beta(1, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | mean(X) 53 | variance(X) 54 | skewness(X) 55 | kurtosis(X) 56 | 57 | cdf(X, quantile(X, 0.7)) 58 | quantile(X, cdf(X, 0.7)) 59 | } 60 | -------------------------------------------------------------------------------- /man/quantile.Binomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Binomial.R 3 | \name{quantile.Binomial} 4 | \alias{quantile.Binomial} 5 | \title{Determine quantiles of a Binomial distribution} 6 | \usage{ 7 | \method{quantile}{Binomial}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Binomial} object created by a call to \code{\link[=Binomial]{Binomial()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Shoul the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qbinom}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Binomial(10, 0.2) 42 | X 43 | 44 | mean(X) 45 | variance(X) 46 | skewness(X) 47 | kurtosis(X) 48 | 49 | random(X, 10) 50 | 51 | pdf(X, 2L) 52 | log_pdf(X, 2L) 53 | 54 | cdf(X, 4L) 55 | quantile(X, 0.7) 56 | 57 | cdf(X, quantile(X, 0.7)) 58 | quantile(X, cdf(X, 7)) 59 | } 60 | -------------------------------------------------------------------------------- /man/quantile.Categorical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Categorical.R 3 | \name{quantile.Categorical} 4 | \alias{quantile.Categorical} 5 | \title{Determine quantiles of a Categorical discrete distribution} 6 | \usage{ 7 | \method{quantile}{Categorical}(x, probs, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Categorical} object created by a call to \code{\link[=Categorical]{Categorical()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{...}{Unused. Unevaluated arguments will generate a warning to 15 | catch mispellings or other possible errors.} 16 | } 17 | \value{ 18 | A vector of quantiles, one for each element of \code{probs}. 19 | } 20 | \description{ 21 | \code{quantile()} is the inverse of \code{cdf()}. 22 | } 23 | \examples{ 24 | 25 | set.seed(27) 26 | 27 | X <- Categorical(1:3, p = c(0.4, 0.1, 0.5)) 28 | X 29 | 30 | Y <- Categorical(LETTERS[1:4]) 31 | Y 32 | 33 | random(X, 10) 34 | random(Y, 10) 35 | 36 | pdf(X, 1) 37 | log_pdf(X, 1) 38 | 39 | cdf(X, 1) 40 | quantile(X, 0.5) 41 | 42 | # cdfs are only defined for numeric sample spaces. this errors! 43 | # cdf(Y, "a") 44 | 45 | # same for quantiles. this also errors! 46 | # quantile(Y, 0.7) 47 | } 48 | -------------------------------------------------------------------------------- /man/quantile.Cauchy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Cauchy.R 3 | \name{quantile.Cauchy} 4 | \alias{quantile.Cauchy} 5 | \title{Determine quantiles of a Cauchy distribution} 6 | \usage{ 7 | \method{quantile}{Cauchy}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Cauchy} object created by a call to \code{\link[=Cauchy]{Cauchy()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qcauchy}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Cauchy(10, 0.2) 42 | X 43 | 44 | mean(X) 45 | variance(X) 46 | skewness(X) 47 | kurtosis(X) 48 | 49 | random(X, 10) 50 | 51 | pdf(X, 2) 52 | log_pdf(X, 2) 53 | 54 | cdf(X, 2) 55 | quantile(X, 0.7) 56 | 57 | cdf(X, quantile(X, 0.7)) 58 | quantile(X, cdf(X, 7)) 59 | } 60 | -------------------------------------------------------------------------------- /man/quantile.ChiSquare.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ChiSquare.R 3 | \name{quantile.ChiSquare} 4 | \alias{quantile.ChiSquare} 5 | \title{Determine quantiles of a chi square distribution} 6 | \usage{ 7 | \method{quantile}{ChiSquare}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{ChiSquare} object created by a call to \code{\link[=ChiSquare]{ChiSquare()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qchisq}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- ChiSquare(5) 42 | X 43 | 44 | mean(X) 45 | variance(X) 46 | skewness(X) 47 | kurtosis(X) 48 | 49 | random(X, 10) 50 | 51 | pdf(X, 2) 52 | log_pdf(X, 2) 53 | 54 | cdf(X, 4) 55 | quantile(X, 0.7) 56 | 57 | cdf(X, quantile(X, 0.7)) 58 | quantile(X, cdf(X, 7)) 59 | } 60 | -------------------------------------------------------------------------------- /man/quantile.Erlang.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Erlang.R 3 | \name{quantile.Erlang} 4 | \alias{quantile.Erlang} 5 | \title{Determine quantiles of an Erlang distribution} 6 | \usage{ 7 | \method{quantile}{Erlang}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{Erlang} object created by a call to \code{\link[=Erlang]{Erlang()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qgamma}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Erlang(5, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.Exponential.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Exponential.R 3 | \name{quantile.Exponential} 4 | \alias{quantile.Exponential} 5 | \title{Determine quantiles of an Exponential distribution} 6 | \usage{ 7 | \method{quantile}{Exponential}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{Exponential} object created by a call to \code{\link[=Exponential]{Exponential()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qexp}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Exponential(5) 42 | X 43 | 44 | mean(X) 45 | variance(X) 46 | skewness(X) 47 | kurtosis(X) 48 | 49 | random(X, 10) 50 | 51 | pdf(X, 2) 52 | log_pdf(X, 2) 53 | 54 | cdf(X, 4) 55 | quantile(X, 0.7) 56 | 57 | cdf(X, quantile(X, 0.7)) 58 | quantile(X, cdf(X, 7)) 59 | } 60 | -------------------------------------------------------------------------------- /man/quantile.FisherF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/FisherF.R 3 | \name{quantile.FisherF} 4 | \alias{quantile.FisherF} 5 | \title{Determine quantiles of an F distribution} 6 | \usage{ 7 | \method{quantile}{FisherF}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{FisherF} object created by a call to \code{\link[=FisherF]{FisherF()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qf}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- FisherF(5, 10, 0.2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.Frechet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Frechet.R 3 | \name{quantile.Frechet} 4 | \alias{quantile.Frechet} 5 | \title{Determine quantiles of a Frechet distribution} 6 | \usage{ 7 | \method{quantile}{Frechet}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Frechet} object created by a call to \code{\link[=Frechet]{Frechet()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{qgev}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Frechet(0, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.GEV.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedExtremeValue.R 3 | \name{quantile.GEV} 4 | \alias{quantile.GEV} 5 | \title{Determine quantiles of a GEV distribution} 6 | \usage{ 7 | \method{quantile}{GEV}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{GEV} object created by a call to \code{\link[=GEV]{GEV()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{qgev}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- GEV(1, 2, 0.1) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.GP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedPareto.R 3 | \name{quantile.GP} 4 | \alias{quantile.GP} 5 | \title{Determine quantiles of a GP distribution} 6 | \usage{ 7 | \method{quantile}{GP}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{GP} object created by a call to \code{\link[=GP]{GP()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{qgp}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- GP(0, 2, 0.1) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.Gamma.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gamma.R 3 | \name{quantile.Gamma} 4 | \alias{quantile.Gamma} 5 | \title{Determine quantiles of a Gamma distribution} 6 | \usage{ 7 | \method{quantile}{Gamma}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Gamma} object created by a call to \code{\link[=Gamma]{Gamma()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qgamma}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Gamma(5, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.Geometric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Geometric.R 3 | \name{quantile.Geometric} 4 | \alias{quantile.Geometric} 5 | \title{Determine quantiles of a Geometric distribution} 6 | \usage{ 7 | \method{quantile}{Geometric}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Geometric} object created by a call to \code{\link[=Geometric]{Geometric()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qgeom}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | Determine quantiles of a Geometric distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Geometric(0.3) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | } 52 | \seealso{ 53 | Other Geometric distribution: 54 | \code{\link{cdf.Geometric}()}, 55 | \code{\link{pdf.Geometric}()}, 56 | \code{\link{random.Geometric}()} 57 | } 58 | \concept{Geometric distribution} 59 | -------------------------------------------------------------------------------- /man/quantile.Gumbel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gumbel.R 3 | \name{quantile.Gumbel} 4 | \alias{quantile.Gumbel} 5 | \title{Determine quantiles of a Gumbel distribution} 6 | \usage{ 7 | \method{quantile}{Gumbel}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Gumbel} object created by a call to \code{\link[=Gumbel]{Gumbel()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{qgev}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Gumbel(1, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.Logistic.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Logistic.R 3 | \name{quantile.Logistic} 4 | \alias{quantile.Logistic} 5 | \title{Determine quantiles of a Logistic distribution} 6 | \usage{ 7 | \method{quantile}{Logistic}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Logistic} object created by a call to \code{\link[=Logistic]{Logistic()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qlogis}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | Determine quantiles of a Logistic distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Logistic(2, 4) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | } 52 | \seealso{ 53 | Other Logistic distribution: 54 | \code{\link{cdf.Logistic}()}, 55 | \code{\link{pdf.Logistic}()}, 56 | \code{\link{random.Logistic}()} 57 | } 58 | \concept{Logistic distribution} 59 | -------------------------------------------------------------------------------- /man/quantile.Poisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Poisson.R 3 | \name{quantile.Poisson} 4 | \alias{quantile.Poisson} 5 | \title{Determine quantiles of a Poisson distribution} 6 | \usage{ 7 | \method{quantile}{Poisson}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Poisson} object created by a call to \code{\link[=Poisson]{Poisson()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qpois}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Poisson(2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.RevWeibull.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ReversedWeibull.R 3 | \name{quantile.RevWeibull} 4 | \alias{quantile.RevWeibull} 5 | \title{Determine quantiles of a RevWeibull distribution} 6 | \usage{ 7 | \method{quantile}{RevWeibull}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{RevWeibull} object created by a call to \code{\link[=RevWeibull]{RevWeibull()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[revdbayes]{qgev}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- RevWeibull(1, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.Tukey.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Tukey.R 3 | \name{quantile.Tukey} 4 | \alias{quantile.Tukey} 5 | \title{Determine quantiles of a Tukey distribution} 6 | \usage{ 7 | \method{quantile}{Tukey}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A vector of elements whose cumulative probabilities you would 11 | like to determine given the distribution \code{d}.} 12 | 13 | \item{probs}{A vector of probabilities.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 18 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 19 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 20 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 21 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 22 | lengths match and otherwise \code{elementwise = FALSE} is used.} 23 | 24 | \item{...}{Arguments to be passed to \code{\link[stats]{qtukey}}. 25 | Unevaluated arguments will generate a warning to catch mispellings or other 26 | possible errors.} 27 | } 28 | \value{ 29 | In case of a single distribution object, either a numeric 30 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 31 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 32 | distribution object, a matrix with \code{length(probs)} columns containing all 33 | possible combinations. 34 | } 35 | \description{ 36 | Determine quantiles of a Tukey distribution 37 | } 38 | \examples{ 39 | 40 | set.seed(27) 41 | 42 | X <- Tukey(4L, 16L, 2L) 43 | X 44 | 45 | cdf(X, 4) 46 | quantile(X, 0.7) 47 | } 48 | \seealso{ 49 | Other Tukey distribution: 50 | \code{\link{cdf.Tukey}()} 51 | } 52 | \concept{Tukey distribution} 53 | -------------------------------------------------------------------------------- /man/quantile.Uniform.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Uniform.R 3 | \name{quantile.Uniform} 4 | \alias{quantile.Uniform} 5 | \title{Determine quantiles of a continuous Uniform distribution} 6 | \usage{ 7 | \method{quantile}{Uniform}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Uniform} object created by a call to \code{\link[=Uniform]{Uniform()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qunif}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | \code{quantile()} is the inverse of \code{cdf()}. 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Uniform(1, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 0.7) 47 | log_pdf(X, 0.7) 48 | 49 | cdf(X, 0.7) 50 | quantile(X, 0.7) 51 | 52 | cdf(X, quantile(X, 0.7)) 53 | quantile(X, cdf(X, 0.7)) 54 | } 55 | -------------------------------------------------------------------------------- /man/quantile.Weibull.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Weibull.R 3 | \name{quantile.Weibull} 4 | \alias{quantile.Weibull} 5 | \title{Determine quantiles of a Weibull distribution} 6 | \usage{ 7 | \method{quantile}{Weibull}(x, probs, drop = TRUE, elementwise = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Weibull} object created by a call to \code{\link[=Weibull]{Weibull()}}.} 11 | 12 | \item{probs}{A vector of probabilities.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{elementwise}{logical. Should each distribution in \code{x} be evaluated 17 | at all elements of \code{probs} (\code{elementwise = FALSE}, yielding a matrix)? 18 | Or, if \code{x} and \code{probs} have the same length, should the evaluation be 19 | done element by element (\code{elementwise = TRUE}, yielding a vector)? The 20 | default of \code{NULL} means that \code{elementwise = TRUE} is used if the 21 | lengths match and otherwise \code{elementwise = FALSE} is used.} 22 | 23 | \item{...}{Arguments to be passed to \code{\link[stats]{qweibull}}. 24 | Unevaluated arguments will generate a warning to catch mispellings or other 25 | possible errors.} 26 | } 27 | \value{ 28 | In case of a single distribution object, either a numeric 29 | vector of length \code{probs} (if \code{drop = TRUE}, default) or a \code{matrix} with 30 | \code{length(probs)} columns (if \code{drop = FALSE}). In case of a vectorized 31 | distribution object, a matrix with \code{length(probs)} columns containing all 32 | possible combinations. 33 | } 34 | \description{ 35 | Determine quantiles of a Weibull distribution 36 | } 37 | \examples{ 38 | 39 | set.seed(27) 40 | 41 | X <- Weibull(0.3, 2) 42 | X 43 | 44 | random(X, 10) 45 | 46 | pdf(X, 2) 47 | log_pdf(X, 2) 48 | 49 | cdf(X, 4) 50 | quantile(X, 0.7) 51 | } 52 | \seealso{ 53 | Other Weibull distribution: 54 | \code{\link{cdf.Weibull}()}, 55 | \code{\link{pdf.Weibull}()}, 56 | \code{\link{random.Weibull}()} 57 | } 58 | \concept{Weibull distribution} 59 | -------------------------------------------------------------------------------- /man/random.Bernoulli.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Bernoulli.R 3 | \name{random.Bernoulli} 4 | \alias{random.Bernoulli} 5 | \title{Draw a random sample from a Bernoulli distribution} 6 | \usage{ 7 | \method{random}{Bernoulli}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Bernoulli} object created by a call to \code{\link[=Bernoulli]{Bernoulli()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Bernoulli distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Bernoulli(0.7) 32 | X 33 | 34 | mean(X) 35 | variance(X) 36 | skewness(X) 37 | kurtosis(X) 38 | 39 | random(X, 10) 40 | pdf(X, 1) 41 | log_pdf(X, 1) 42 | cdf(X, 0) 43 | quantile(X, 0.7) 44 | 45 | cdf(X, quantile(X, 0.7)) 46 | quantile(X, cdf(X, 0.7)) 47 | } 48 | -------------------------------------------------------------------------------- /man/random.Beta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Beta.R 3 | \name{random.Beta} 4 | \alias{random.Beta} 5 | \title{Draw a random sample from a Beta distribution} 6 | \usage{ 7 | \method{random}{Beta}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Beta} object created by a call to \code{\link[=Beta]{Beta()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | Values in \verb{[0, 1]}. In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Beta distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Beta(1, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 0.7) 37 | log_pdf(X, 0.7) 38 | 39 | cdf(X, 0.7) 40 | quantile(X, 0.7) 41 | 42 | mean(X) 43 | variance(X) 44 | skewness(X) 45 | kurtosis(X) 46 | 47 | cdf(X, quantile(X, 0.7)) 48 | quantile(X, cdf(X, 0.7)) 49 | } 50 | -------------------------------------------------------------------------------- /man/random.Binomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Binomial.R 3 | \name{random.Binomial} 4 | \alias{random.Binomial} 5 | \title{Draw a random sample from a Binomial distribution} 6 | \usage{ 7 | \method{random}{Binomial}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Binomial} object created by a call to \code{\link[=Binomial]{Binomial()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | Integers containing values between \code{0} and \code{x$size}. 21 | In case of a single distribution object or \code{n = 1}, either a numeric 22 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 23 | (if \code{drop = FALSE}). 24 | } 25 | \description{ 26 | Draw a random sample from a Binomial distribution 27 | } 28 | \examples{ 29 | 30 | set.seed(27) 31 | 32 | X <- Binomial(10, 0.2) 33 | X 34 | 35 | mean(X) 36 | variance(X) 37 | skewness(X) 38 | kurtosis(X) 39 | 40 | random(X, 10) 41 | 42 | pdf(X, 2L) 43 | log_pdf(X, 2L) 44 | 45 | cdf(X, 4L) 46 | quantile(X, 0.7) 47 | 48 | cdf(X, quantile(X, 0.7)) 49 | quantile(X, cdf(X, 7)) 50 | } 51 | -------------------------------------------------------------------------------- /man/random.Categorical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Categorical.R 3 | \name{random.Categorical} 4 | \alias{random.Categorical} 5 | \title{Draw a random sample from a Categorical distribution} 6 | \usage{ 7 | \method{random}{Categorical}(x, n = 1L, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Categorical} object created by a call to \code{\link[=Categorical]{Categorical()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{...}{Unused. Unevaluated arguments will generate a warning to 15 | catch mispellings or other possible errors.} 16 | } 17 | \value{ 18 | A vector containing values from \code{outcomes} of length \code{n}. 19 | } 20 | \description{ 21 | Draw a random sample from a Categorical distribution 22 | } 23 | \examples{ 24 | 25 | set.seed(27) 26 | 27 | X <- Categorical(1:3, p = c(0.4, 0.1, 0.5)) 28 | X 29 | 30 | Y <- Categorical(LETTERS[1:4]) 31 | Y 32 | 33 | random(X, 10) 34 | random(Y, 10) 35 | 36 | pdf(X, 1) 37 | log_pdf(X, 1) 38 | 39 | cdf(X, 1) 40 | quantile(X, 0.5) 41 | 42 | # cdfs are only defined for numeric sample spaces. this errors! 43 | # cdf(Y, "a") 44 | 45 | # same for quantiles. this also errors! 46 | # quantile(Y, 0.7) 47 | } 48 | -------------------------------------------------------------------------------- /man/random.Cauchy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Cauchy.R 3 | \name{random.Cauchy} 4 | \alias{random.Cauchy} 5 | \title{Draw a random sample from a Cauchy distribution} 6 | \usage{ 7 | \method{random}{Cauchy}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Cauchy} object created by a call to \code{\link[=Cauchy]{Cauchy()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Cauchy distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Cauchy(10, 0.2) 32 | X 33 | 34 | mean(X) 35 | variance(X) 36 | skewness(X) 37 | kurtosis(X) 38 | 39 | random(X, 10) 40 | 41 | pdf(X, 2) 42 | log_pdf(X, 2) 43 | 44 | cdf(X, 2) 45 | quantile(X, 0.7) 46 | 47 | cdf(X, quantile(X, 0.7)) 48 | quantile(X, cdf(X, 7)) 49 | } 50 | -------------------------------------------------------------------------------- /man/random.ChiSquare.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ChiSquare.R 3 | \name{random.ChiSquare} 4 | \alias{random.ChiSquare} 5 | \title{Draw a random sample from a chi square distribution} 6 | \usage{ 7 | \method{random}{ChiSquare}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{ChiSquare} object created by a call to \code{\link[=ChiSquare]{ChiSquare()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a chi square distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- ChiSquare(5) 32 | X 33 | 34 | mean(X) 35 | variance(X) 36 | skewness(X) 37 | kurtosis(X) 38 | 39 | random(X, 10) 40 | 41 | pdf(X, 2) 42 | log_pdf(X, 2) 43 | 44 | cdf(X, 4) 45 | quantile(X, 0.7) 46 | 47 | cdf(X, quantile(X, 0.7)) 48 | quantile(X, cdf(X, 7)) 49 | } 50 | -------------------------------------------------------------------------------- /man/random.Erlang.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Erlang.R 3 | \name{random.Erlang} 4 | \alias{random.Erlang} 5 | \title{Draw a random sample from an Erlang distribution} 6 | \usage{ 7 | \method{random}{Erlang}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{Erlang} object created by a call to \code{\link[=Erlang]{Erlang()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from an Erlang distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Erlang(5, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 2) 37 | log_pdf(X, 2) 38 | 39 | cdf(X, 4) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.Exponential.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Exponential.R 3 | \name{random.Exponential} 4 | \alias{random.Exponential} 5 | \title{Draw a random sample from an Exponential distribution} 6 | \usage{ 7 | \method{random}{Exponential}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{Exponential} object created by a call to \code{\link[=Exponential]{Exponential()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from an Exponential distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Exponential(5) 32 | X 33 | 34 | mean(X) 35 | variance(X) 36 | skewness(X) 37 | kurtosis(X) 38 | 39 | random(X, 10) 40 | 41 | pdf(X, 2) 42 | log_pdf(X, 2) 43 | 44 | cdf(X, 4) 45 | quantile(X, 0.7) 46 | 47 | cdf(X, quantile(X, 0.7)) 48 | quantile(X, cdf(X, 7)) 49 | } 50 | -------------------------------------------------------------------------------- /man/random.FisherF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/FisherF.R 3 | \name{random.FisherF} 4 | \alias{random.FisherF} 5 | \title{Draw a random sample from an F distribution} 6 | \usage{ 7 | \method{random}{FisherF}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{FisherF} object created by a call to \code{\link[=FisherF]{FisherF()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from an F distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- FisherF(5, 10, 0.2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 2) 37 | log_pdf(X, 2) 38 | 39 | cdf(X, 4) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.Frechet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Frechet.R 3 | \name{random.Frechet} 4 | \alias{random.Frechet} 5 | \title{Draw a random sample from a Frechet distribution} 6 | \usage{ 7 | \method{random}{Frechet}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Frechet} object created by a call to \code{\link[=Frechet]{Frechet()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Frechet distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Frechet(0, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 0.7) 37 | log_pdf(X, 0.7) 38 | 39 | cdf(X, 0.7) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 0.7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.GEV.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedExtremeValue.R 3 | \name{random.GEV} 4 | \alias{random.GEV} 5 | \title{Draw a random sample from a GEV distribution} 6 | \usage{ 7 | \method{random}{GEV}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{GEV} object created by a call to \code{\link[=GEV]{GEV()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a GEV distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- GEV(1, 2, 0.1) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 0.7) 37 | log_pdf(X, 0.7) 38 | 39 | cdf(X, 0.7) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 0.7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.GP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedPareto.R 3 | \name{random.GP} 4 | \alias{random.GP} 5 | \title{Draw a random sample from a GP distribution} 6 | \usage{ 7 | \method{random}{GP}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{GP} object created by a call to \code{\link[=GP]{GP()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a GP distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- GP(0, 2, 0.1) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 0.7) 37 | log_pdf(X, 0.7) 38 | 39 | cdf(X, 0.7) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 0.7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.Gamma.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gamma.R 3 | \name{random.Gamma} 4 | \alias{random.Gamma} 5 | \title{Draw a random sample from a Gamma distribution} 6 | \usage{ 7 | \method{random}{Gamma}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Gamma} object created by a call to \code{\link[=Gamma]{Gamma()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Gamma distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Gamma(5, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 2) 37 | log_pdf(X, 2) 38 | 39 | cdf(X, 4) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.Geometric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Geometric.R 3 | \name{random.Geometric} 4 | \alias{random.Geometric} 5 | \title{Draw a random sample from a Geometric distribution} 6 | \usage{ 7 | \method{random}{Geometric}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Geometric} object created by a call to \code{\link[=Geometric]{Geometric()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Please see the documentation of \code{\link[=Geometric]{Geometric()}} for some properties 26 | of the Geometric distribution, as well as extensive examples 27 | showing to how calculate p-values and confidence intervals. 28 | } 29 | \examples{ 30 | 31 | set.seed(27) 32 | 33 | X <- Geometric(0.3) 34 | X 35 | 36 | random(X, 10) 37 | 38 | pdf(X, 2) 39 | log_pdf(X, 2) 40 | 41 | cdf(X, 4) 42 | quantile(X, 0.7) 43 | } 44 | \seealso{ 45 | Other Geometric distribution: 46 | \code{\link{cdf.Geometric}()}, 47 | \code{\link{pdf.Geometric}()}, 48 | \code{\link{quantile.Geometric}()} 49 | } 50 | \concept{Geometric distribution} 51 | -------------------------------------------------------------------------------- /man/random.Gumbel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gumbel.R 3 | \name{random.Gumbel} 4 | \alias{random.Gumbel} 5 | \title{Draw a random sample from a Gumbel distribution} 6 | \usage{ 7 | \method{random}{Gumbel}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Gumbel} object created by a call to \code{\link[=Gumbel]{Gumbel()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Gumbel distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Gumbel(1, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 0.7) 37 | log_pdf(X, 0.7) 38 | 39 | cdf(X, 0.7) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 0.7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.HurdleNegativeBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/HurdleNegativeBinomial.R 3 | \name{random.HurdleNegativeBinomial} 4 | \alias{random.HurdleNegativeBinomial} 5 | \title{Draw a random sample from a hurdle negative binomial distribution} 6 | \usage{ 7 | \method{random}{HurdleNegativeBinomial}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{HurdleNegativeBinomial} object created by a call to \code{\link[=HurdleNegativeBinomial]{HurdleNegativeBinomial()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a hurdle negative binomial distribution 26 | } 27 | \examples{ 28 | ## set up a hurdle negative binomial distribution 29 | X <- HurdleNegativeBinomial(mu = 2.5, theta = 1, pi = 0.75) 30 | X 31 | 32 | ## standard functions 33 | pdf(X, 0:8) 34 | cdf(X, 0:8) 35 | quantile(X, seq(0, 1, by = 0.25)) 36 | 37 | ## cdf() and quantile() are inverses for each other 38 | quantile(X, cdf(X, 3)) 39 | 40 | ## density visualization 41 | plot(0:8, pdf(X, 0:8), type = "h", lwd = 2) 42 | 43 | ## corresponding sample with histogram of empirical frequencies 44 | set.seed(0) 45 | x <- random(X, 500) 46 | hist(x, breaks = -1:max(x) + 0.5) 47 | } 48 | -------------------------------------------------------------------------------- /man/random.HurdlePoisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/HurdlePoisson.R 3 | \name{random.HurdlePoisson} 4 | \alias{random.HurdlePoisson} 5 | \title{Draw a random sample from a hurdle Poisson distribution} 6 | \usage{ 7 | \method{random}{HurdlePoisson}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{HurdlePoisson} object created by a call to \code{\link[=HurdlePoisson]{HurdlePoisson()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a hurdle Poisson distribution 26 | } 27 | \examples{ 28 | ## set up a hurdle Poisson distribution 29 | X <- HurdlePoisson(lambda = 2.5, pi = 0.75) 30 | X 31 | 32 | ## standard functions 33 | pdf(X, 0:8) 34 | cdf(X, 0:8) 35 | quantile(X, seq(0, 1, by = 0.25)) 36 | 37 | ## cdf() and quantile() are inverses for each other 38 | quantile(X, cdf(X, 3)) 39 | 40 | ## density visualization 41 | plot(0:8, pdf(X, 0:8), type = "h", lwd = 2) 42 | 43 | ## corresponding sample with histogram of empirical frequencies 44 | set.seed(0) 45 | x <- random(X, 500) 46 | hist(x, breaks = -1:max(x) + 0.5) 47 | } 48 | -------------------------------------------------------------------------------- /man/random.HyperGeometric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/HyperGeometric.R 3 | \name{random.HyperGeometric} 4 | \alias{random.HyperGeometric} 5 | \title{Draw a random sample from a HyperGeometric distribution} 6 | \usage{ 7 | \method{random}{HyperGeometric}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{HyperGeometric} object created by a call to \code{\link[=HyperGeometric]{HyperGeometric()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Please see the documentation of \code{\link[=HyperGeometric]{HyperGeometric()}} for some properties 26 | of the HyperGeometric distribution, as well as extensive examples 27 | showing to how calculate p-values and confidence intervals. 28 | } 29 | \examples{ 30 | 31 | set.seed(27) 32 | 33 | X <- HyperGeometric(4, 5, 8) 34 | X 35 | 36 | random(X, 10) 37 | 38 | pdf(X, 2) 39 | log_pdf(X, 2) 40 | 41 | cdf(X, 4) 42 | quantile(X, 0.7) 43 | } 44 | \seealso{ 45 | Other HyperGeometric distribution: 46 | \code{\link{cdf.HyperGeometric}()}, 47 | \code{\link{pdf.HyperGeometric}()}, 48 | \code{\link{quantile.HyperGeometric}()} 49 | } 50 | \concept{HyperGeometric distribution} 51 | -------------------------------------------------------------------------------- /man/random.LogNormal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/LogNormal.R 3 | \name{random.LogNormal} 4 | \alias{random.LogNormal} 5 | \title{Draw a random sample from a LogNormal distribution} 6 | \usage{ 7 | \method{random}{LogNormal}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{LogNormal} object created by a call to \code{\link[=LogNormal]{LogNormal()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a LogNormal distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- LogNormal(0.3, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 2) 37 | log_pdf(X, 2) 38 | 39 | cdf(X, 4) 40 | quantile(X, 0.7) 41 | } 42 | \seealso{ 43 | Other LogNormal distribution: 44 | \code{\link{cdf.LogNormal}()}, 45 | \code{\link{fit_mle.LogNormal}()}, 46 | \code{\link{pdf.LogNormal}()}, 47 | \code{\link{quantile.LogNormal}()} 48 | } 49 | \concept{LogNormal distribution} 50 | -------------------------------------------------------------------------------- /man/random.Logistic.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Logistic.R 3 | \name{random.Logistic} 4 | \alias{random.Logistic} 5 | \title{Draw a random sample from a Logistic distribution} 6 | \usage{ 7 | \method{random}{Logistic}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Logistic} object created by a call to \code{\link[=Logistic]{Logistic()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Logistic distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Logistic(2, 4) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 2) 37 | log_pdf(X, 2) 38 | 39 | cdf(X, 4) 40 | quantile(X, 0.7) 41 | } 42 | \seealso{ 43 | Other Logistic distribution: 44 | \code{\link{cdf.Logistic}()}, 45 | \code{\link{pdf.Logistic}()}, 46 | \code{\link{quantile.Logistic}()} 47 | } 48 | \concept{Logistic distribution} 49 | -------------------------------------------------------------------------------- /man/random.Multinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Multinomial.R 3 | \name{random.Multinomial} 4 | \alias{random.Multinomial} 5 | \title{Draw a random sample from a Multinomial distribution} 6 | \usage{ 7 | \method{random}{Multinomial}(x, n = 1L, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Multinomial} object created by a call to \code{\link[=Multinomial]{Multinomial()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{...}{Unused. Unevaluated arguments will generate a warning to 15 | catch mispellings or other possible errors.} 16 | } 17 | \value{ 18 | An integer vector of length \code{n}. 19 | } 20 | \description{ 21 | Draw a random sample from a Multinomial distribution 22 | } 23 | \examples{ 24 | 25 | set.seed(27) 26 | 27 | X <- Multinomial(size = 5, p = c(0.3, 0.4, 0.2, 0.1)) 28 | X 29 | 30 | random(X, 10) 31 | 32 | # pdf(X, 2) 33 | # log_pdf(X, 2) 34 | } 35 | \seealso{ 36 | Other Multinomial distribution: 37 | \code{\link{pdf.Multinomial}()} 38 | } 39 | \concept{Multinomial distribution} 40 | -------------------------------------------------------------------------------- /man/random.NegativeBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NegativeBinomial.R 3 | \name{random.NegativeBinomial} 4 | \alias{random.NegativeBinomial} 5 | \title{Draw a random sample from a negative binomial distribution} 6 | \usage{ 7 | \method{random}{NegativeBinomial}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{NegativeBinomial} object created by a call to 11 | \code{\link[=NegativeBinomial]{NegativeBinomial()}}.} 12 | 13 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 14 | 15 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 16 | 17 | \item{...}{Unused. Unevaluated arguments will generate a warning to 18 | catch mispellings or other possible errors.} 19 | } 20 | \value{ 21 | In case of a single distribution object or \code{n = 1}, either a numeric 22 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 23 | (if \code{drop = FALSE}). 24 | } 25 | \description{ 26 | Draw a random sample from a negative binomial distribution 27 | } 28 | \examples{ 29 | 30 | set.seed(27) 31 | 32 | X <- NegativeBinomial(size = 5, p = 0.1) 33 | X 34 | 35 | random(X, 10) 36 | 37 | pdf(X, 50) 38 | log_pdf(X, 50) 39 | 40 | cdf(X, 50) 41 | quantile(X, 0.7) 42 | 43 | ## alternative parameterization of X 44 | Y <- NegativeBinomial(mu = 45, size = 5) 45 | Y 46 | cdf(Y, 50) 47 | quantile(Y, 0.7) 48 | } 49 | \seealso{ 50 | Other NegativeBinomial distribution: 51 | \code{\link{cdf.NegativeBinomial}()}, 52 | \code{\link{pdf.NegativeBinomial}()}, 53 | \code{\link{quantile.NegativeBinomial}()} 54 | } 55 | \concept{NegativeBinomial distribution} 56 | -------------------------------------------------------------------------------- /man/random.Poisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Poisson.R 3 | \name{random.Poisson} 4 | \alias{random.Poisson} 5 | \title{Draw a random sample from a Poisson distribution} 6 | \usage{ 7 | \method{random}{Poisson}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Poisson} object created by a call to \code{\link[=Poisson]{Poisson()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Poisson distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Poisson(2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 2) 37 | log_pdf(X, 2) 38 | 39 | cdf(X, 4) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.PoissonBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/PoissonBinomial.R 3 | \name{random.PoissonBinomial} 4 | \alias{random.PoissonBinomial} 5 | \title{Draw a random sample from a PoissonBinomial distribution} 6 | \usage{ 7 | \method{random}{PoissonBinomial}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{PoissonBinomial} object created by a call to \code{\link[=PoissonBinomial]{PoissonBinomial()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | Integers containing values between \code{0} and \code{x$size}. 21 | In case of a single distribution object or \code{n = 1}, either a numeric 22 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 23 | (if \code{drop = FALSE}). 24 | } 25 | \description{ 26 | Draw a random sample from a PoissonBinomial distribution 27 | } 28 | \examples{ 29 | 30 | set.seed(27) 31 | 32 | X <- PoissonBinomial(0.5, 0.3, 0.8) 33 | X 34 | 35 | mean(X) 36 | variance(X) 37 | skewness(X) 38 | kurtosis(X) 39 | 40 | random(X, 10) 41 | 42 | pdf(X, 2) 43 | log_pdf(X, 2) 44 | 45 | cdf(X, 2) 46 | quantile(X, 0.8) 47 | 48 | cdf(X, quantile(X, 0.8)) 49 | quantile(X, cdf(X, 2)) 50 | 51 | ## equivalent definitions of four Poisson binomial distributions 52 | ## each summing up three Bernoulli probabilities 53 | p <- cbind( 54 | p1 = c(0.1, 0.2, 0.1, 0.2), 55 | p2 = c(0.5, 0.5, 0.5, 0.5), 56 | p3 = c(0.8, 0.7, 0.9, 0.8)) 57 | PoissonBinomial(p) 58 | PoissonBinomial(p[, 1], p[, 2], p[, 3]) 59 | PoissonBinomial(p[, 1:2], p[, 3]) 60 | } 61 | -------------------------------------------------------------------------------- /man/random.RevWeibull.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ReversedWeibull.R 3 | \name{random.RevWeibull} 4 | \alias{random.RevWeibull} 5 | \title{Draw a random sample from an RevWeibull distribution} 6 | \usage{ 7 | \method{random}{RevWeibull}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{RevWeibull} object created by a call to \code{\link[=RevWeibull]{RevWeibull()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from an RevWeibull distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- RevWeibull(1, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 0.7) 37 | log_pdf(X, 0.7) 38 | 39 | cdf(X, 0.7) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 0.7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.Tukey.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Tukey.R 3 | \name{random.Tukey} 4 | \alias{random.Tukey} 5 | \title{Draw a random sample from a Tukey distribution} 6 | \usage{ 7 | \method{random}{Tukey}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Tukey} object created by a call to \code{\link[=Tukey]{Tukey()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Tukey distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Tukey(4L, 16L, 2L) 32 | X 33 | 34 | cdf(X, 4) 35 | quantile(X, 0.7) 36 | } 37 | -------------------------------------------------------------------------------- /man/random.Uniform.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Uniform.R 3 | \name{random.Uniform} 4 | \alias{random.Uniform} 5 | \title{Draw a random sample from a continuous Uniform distribution} 6 | \usage{ 7 | \method{random}{Uniform}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Uniform} object created by a call to \code{\link[=Uniform]{Uniform()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | Values in \verb{[a, b]}. In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a continuous Uniform distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Uniform(1, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 0.7) 37 | log_pdf(X, 0.7) 38 | 39 | cdf(X, 0.7) 40 | quantile(X, 0.7) 41 | 42 | cdf(X, quantile(X, 0.7)) 43 | quantile(X, cdf(X, 0.7)) 44 | } 45 | -------------------------------------------------------------------------------- /man/random.Weibull.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Weibull.R 3 | \name{random.Weibull} 4 | \alias{random.Weibull} 5 | \title{Draw a random sample from a Weibull distribution} 6 | \usage{ 7 | \method{random}{Weibull}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{Weibull} object created by a call to \code{\link[=Weibull]{Weibull()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a Weibull distribution 26 | } 27 | \examples{ 28 | 29 | set.seed(27) 30 | 31 | X <- Weibull(0.3, 2) 32 | X 33 | 34 | random(X, 10) 35 | 36 | pdf(X, 2) 37 | log_pdf(X, 2) 38 | 39 | cdf(X, 4) 40 | quantile(X, 0.7) 41 | } 42 | \seealso{ 43 | Other Weibull distribution: 44 | \code{\link{cdf.Weibull}()}, 45 | \code{\link{pdf.Weibull}()}, 46 | \code{\link{quantile.Weibull}()} 47 | } 48 | \concept{Weibull distribution} 49 | -------------------------------------------------------------------------------- /man/random.ZINegativeBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ZINegativeBinomial.R 3 | \name{random.ZINegativeBinomial} 4 | \alias{random.ZINegativeBinomial} 5 | \title{Draw a random sample from a zero-inflated negative binomial distribution} 6 | \usage{ 7 | \method{random}{ZINegativeBinomial}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{ZINegativeBinomial} object created by a call to \code{\link[=ZINegativeBinomial]{ZINegativeBinomial()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a zero-inflated negative binomial distribution 26 | } 27 | \examples{ 28 | ## set up a zero-inflated negative binomial distribution 29 | X <- ZINegativeBinomial(mu = 2.5, theta = 1, pi = 0.25) 30 | X 31 | 32 | ## standard functions 33 | pdf(X, 0:8) 34 | cdf(X, 0:8) 35 | quantile(X, seq(0, 1, by = 0.25)) 36 | 37 | ## cdf() and quantile() are inverses for each other 38 | quantile(X, cdf(X, 3)) 39 | 40 | ## density visualization 41 | plot(0:8, pdf(X, 0:8), type = "h", lwd = 2) 42 | 43 | ## corresponding sample with histogram of empirical frequencies 44 | set.seed(0) 45 | x <- random(X, 500) 46 | hist(x, breaks = -1:max(x) + 0.5) 47 | } 48 | -------------------------------------------------------------------------------- /man/random.ZIPoisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ZIPoisson.R 3 | \name{random.ZIPoisson} 4 | \alias{random.ZIPoisson} 5 | \title{Draw a random sample from a zero-inflated Poisson distribution} 6 | \usage{ 7 | \method{random}{ZIPoisson}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{ZIPoisson} object created by a call to \code{\link[=ZIPoisson]{ZIPoisson()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a zero-inflated Poisson distribution 26 | } 27 | \examples{ 28 | ## set up a zero-inflated Poisson distribution 29 | X <- ZIPoisson(lambda = 2.5, pi = 0.25) 30 | X 31 | 32 | ## standard functions 33 | pdf(X, 0:8) 34 | cdf(X, 0:8) 35 | quantile(X, seq(0, 1, by = 0.25)) 36 | 37 | ## cdf() and quantile() are inverses for each other 38 | quantile(X, cdf(X, 3)) 39 | 40 | ## density visualization 41 | plot(0:8, pdf(X, 0:8), type = "h", lwd = 2) 42 | 43 | ## corresponding sample with histogram of empirical frequencies 44 | set.seed(0) 45 | x <- random(X, 500) 46 | hist(x, breaks = -1:max(x) + 0.5) 47 | } 48 | -------------------------------------------------------------------------------- /man/random.ZTNegativeBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ZTNegativeBinomial.R 3 | \name{random.ZTNegativeBinomial} 4 | \alias{random.ZTNegativeBinomial} 5 | \title{Draw a random sample from a zero-truncated negative binomial distribution} 6 | \usage{ 7 | \method{random}{ZTNegativeBinomial}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{ZTNegativeBinomial} object created by a call to \code{\link[=ZTNegativeBinomial]{ZTNegativeBinomial()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a zero-truncated negative binomial distribution 26 | } 27 | \examples{ 28 | ## set up a zero-truncated negative binomial distribution 29 | X <- ZTNegativeBinomial(mu = 2.5, theta = 1) 30 | X 31 | 32 | ## standard functions 33 | pdf(X, 0:8) 34 | cdf(X, 0:8) 35 | quantile(X, seq(0, 1, by = 0.25)) 36 | 37 | ## cdf() and quantile() are inverses for each other 38 | quantile(X, cdf(X, 3)) 39 | 40 | ## density visualization 41 | plot(0:8, pdf(X, 0:8), type = "h", lwd = 2) 42 | 43 | ## corresponding sample with histogram of empirical frequencies 44 | set.seed(0) 45 | x <- random(X, 500) 46 | hist(x, breaks = -1:max(x) + 0.5) 47 | } 48 | -------------------------------------------------------------------------------- /man/random.ZTPoisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ZTPoisson.R 3 | \name{random.ZTPoisson} 4 | \alias{random.ZTPoisson} 5 | \title{Draw a random sample from a zero-truncated Poisson distribution} 6 | \usage{ 7 | \method{random}{ZTPoisson}(x, n = 1L, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{ZTPoisson} object created by a call to \code{\link[=ZTPoisson]{ZTPoisson()}}.} 11 | 12 | \item{n}{The number of samples to draw. Defaults to \code{1L}.} 13 | 14 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 15 | 16 | \item{...}{Unused. Unevaluated arguments will generate a warning to 17 | catch mispellings or other possible errors.} 18 | } 19 | \value{ 20 | In case of a single distribution object or \code{n = 1}, either a numeric 21 | vector of length \code{n} (if \code{drop = TRUE}, default) or a \code{matrix} with \code{n} columns 22 | (if \code{drop = FALSE}). 23 | } 24 | \description{ 25 | Draw a random sample from a zero-truncated Poisson distribution 26 | } 27 | \examples{ 28 | ## set up a zero-truncated Poisson distribution 29 | X <- ZTPoisson(lambda = 2.5) 30 | X 31 | 32 | ## standard functions 33 | pdf(X, 0:8) 34 | cdf(X, 0:8) 35 | quantile(X, seq(0, 1, by = 0.25)) 36 | 37 | ## cdf() and quantile() are inverses for each other 38 | quantile(X, cdf(X, 3)) 39 | 40 | ## density visualization 41 | plot(0:8, pdf(X, 0:8), type = "h", lwd = 2) 42 | 43 | ## corresponding sample with histogram of empirical frequencies 44 | set.seed(0) 45 | x <- random(X, 500) 46 | hist(x, breaks = -1:max(x) + 0.5) 47 | } 48 | -------------------------------------------------------------------------------- /man/suff_stat.Bernoulli.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Bernoulli.R 3 | \name{suff_stat.Bernoulli} 4 | \alias{suff_stat.Bernoulli} 5 | \title{Compute the sufficient statistics for a Bernoulli distribution from data} 6 | \usage{ 7 | \method{suff_stat}{Bernoulli}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Bernoulli} object.} 11 | 12 | \item{x}{A vector of zeroes and ones.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | A named list of the sufficient statistics of the Bernoulli 18 | distribution: 19 | \itemize{ 20 | \item \code{successes}: The number of successful trials (\code{sum(x == 1)}) 21 | \item \code{failures}: The number of failed trials (\code{sum(x == 0)}). 22 | } 23 | } 24 | \description{ 25 | Compute the sufficient statistics for a Bernoulli distribution from data 26 | } 27 | -------------------------------------------------------------------------------- /man/suff_stat.Binomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Binomial.R 3 | \name{suff_stat.Binomial} 4 | \alias{suff_stat.Binomial} 5 | \title{Compute the sufficient statistics for the Binomial distribution from data} 6 | \usage{ 7 | \method{suff_stat}{Binomial}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Binomial} object.} 11 | 12 | \item{x}{A vector of zeroes and ones.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | A named list of the sufficient statistics of the Binomial 18 | distribution: 19 | \itemize{ 20 | \item \code{successes}: The total number of successful trials. 21 | \item \code{experiments}: The number of experiments run. 22 | \item \code{trials}: The number of trials run per experiment. 23 | } 24 | } 25 | \description{ 26 | Compute the sufficient statistics for the Binomial distribution from data 27 | } 28 | -------------------------------------------------------------------------------- /man/suff_stat.Exponential.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Exponential.R 3 | \name{suff_stat.Exponential} 4 | \alias{suff_stat.Exponential} 5 | \title{Compute the sufficient statistics of an Exponential distribution from data} 6 | \usage{ 7 | \method{suff_stat}{Exponential}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Exponential} object created by a call to \code{\link[=Exponential]{Exponential()}}.} 11 | 12 | \item{x}{A vector of data.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | A named list of the sufficient statistics of the exponential 18 | distribution: 19 | \itemize{ 20 | \item \code{sum}: The sum of the observations. 21 | \item \code{samples}: The number of observations. 22 | } 23 | } 24 | \description{ 25 | Compute the sufficient statistics of an Exponential distribution from data 26 | } 27 | -------------------------------------------------------------------------------- /man/suff_stat.Gamma.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gamma.R 3 | \name{suff_stat.Gamma} 4 | \alias{suff_stat.Gamma} 5 | \title{Compute the sufficient statistics for a Gamma distribution from data} 6 | \usage{ 7 | \method{suff_stat}{Gamma}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Gamma} object created by a call to \code{\link[=Gamma]{Gamma()}}.} 11 | 12 | \item{x}{A vector to fit the Gamma distribution to.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | a \code{Gamma} object 18 | } 19 | \description{ 20 | \itemize{ 21 | \item \code{sum}: The sum of the data. 22 | \item \code{log_sum}: The log of the sum of the data. 23 | \item \code{samples}: The number of samples in the data. 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /man/suff_stat.Geometric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Geometric.R 3 | \name{suff_stat.Geometric} 4 | \alias{suff_stat.Geometric} 5 | \title{Compute the sufficient statistics for the Geometric distribution from data} 6 | \usage{ 7 | \method{suff_stat}{Geometric}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Geometric} object.} 11 | 12 | \item{x}{A vector of zeroes and ones.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | A named list of the sufficient statistics of the Geometric 18 | distribution: 19 | \itemize{ 20 | \item \code{trials}: The total number of trials ran until the first success. 21 | \item \code{experiments}: The number of experiments run. 22 | } 23 | } 24 | \description{ 25 | Compute the sufficient statistics for the Geometric distribution from data 26 | } 27 | -------------------------------------------------------------------------------- /man/suff_stat.LogNormal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/LogNormal.R 3 | \name{suff_stat.LogNormal} 4 | \alias{suff_stat.LogNormal} 5 | \title{Compute the sufficient statistics for a Log-normal distribution from data} 6 | \usage{ 7 | \method{suff_stat}{LogNormal}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{LogNormal} object created by a call to \code{\link[=LogNormal]{LogNormal()}}.} 11 | 12 | \item{x}{A vector of data.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | A named list of the sufficient statistics of the normal distribution: 18 | \itemize{ 19 | \item \code{mu}: The sample mean of the log of the data. 20 | \item \code{sigma}: The sample standard deviation of the log of the data. 21 | \item \code{samples}: The number of samples in the data. 22 | } 23 | } 24 | \description{ 25 | Compute the sufficient statistics for a Log-normal distribution from data 26 | } 27 | -------------------------------------------------------------------------------- /man/suff_stat.Normal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Normal.R 3 | \name{suff_stat.Normal} 4 | \alias{suff_stat.Normal} 5 | \title{Compute the sufficient statistics for a Normal distribution from data} 6 | \usage{ 7 | \method{suff_stat}{Normal}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{Normal} object created by a call to \code{\link[=Normal]{Normal()}}.} 11 | 12 | \item{x}{A vector of data.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | A named list of the sufficient statistics of the normal 18 | distribution: 19 | \itemize{ 20 | \item \code{mu}: The sample mean of the data. 21 | \item \code{sigma}: The sample standard deviation of the data. 22 | \item \code{samples}: The number of samples in the data. 23 | } 24 | } 25 | \description{ 26 | Compute the sufficient statistics for a Normal distribution from data 27 | } 28 | -------------------------------------------------------------------------------- /man/suff_stat.Poisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Poisson.R 3 | \name{suff_stat.Poisson} 4 | \alias{suff_stat.Poisson} 5 | \title{Compute the sufficient statistics of an Poisson distribution from data} 6 | \usage{ 7 | \method{suff_stat}{Poisson}(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Poisson} object created by a call to \code{\link[=Poisson]{Poisson()}}.} 11 | 12 | \item{x}{A vector of data.} 13 | 14 | \item{...}{Unused.} 15 | } 16 | \value{ 17 | A named list of the sufficient statistics of the Poisson 18 | distribution: 19 | \itemize{ 20 | \item \code{sum}: The sum of the data. 21 | \item \code{samples}: The number of samples in the data. 22 | } 23 | } 24 | \description{ 25 | Compute the sufficient statistics of an Poisson distribution from data 26 | } 27 | -------------------------------------------------------------------------------- /man/suff_stat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/methods.R 3 | \name{suff_stat} 4 | \alias{suff_stat} 5 | \title{Compute the sufficient statistics of a distribution from data} 6 | \usage{ 7 | suff_stat(d, x, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An object. The package provides methods for distribution 11 | objects such as those from \code{\link[=Normal]{Normal()}} or \code{\link[=Binomial]{Binomial()}} etc.} 12 | 13 | \item{x}{A vector of data to compute the likelihood.} 14 | 15 | \item{...}{Arguments passed to methods. Unevaluated arguments will generate a warning to 16 | catch mispellings or other possible errors.} 17 | } 18 | \value{ 19 | a named list of sufficient statistics 20 | } 21 | \description{ 22 | Generic function for computing the sufficient statistics of 23 | a distribution based on empirical data. 24 | } 25 | \examples{ 26 | X <- Normal() 27 | suff_stat(X, c(-1, 0, 0, 0, 3)) 28 | } 29 | -------------------------------------------------------------------------------- /man/support.Bernoulli.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Bernoulli.R 3 | \name{support.Bernoulli} 4 | \alias{support.Bernoulli} 5 | \title{Return the support of the Bernoulli distribution} 6 | \usage{ 7 | \method{support}{Bernoulli}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Bernoulli} object created by a call to \code{\link[=Bernoulli]{Bernoulli()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Bernoulli distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Beta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Beta.R 3 | \name{support.Beta} 4 | \alias{support.Beta} 5 | \title{Return the support of the Beta distribution} 6 | \usage{ 7 | \method{support}{Beta}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Beta} object created by a call to \code{\link[=Beta]{Beta()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Beta distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Binomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Binomial.R 3 | \name{support.Binomial} 4 | \alias{support.Binomial} 5 | \title{Return the support of the Binomial distribution} 6 | \usage{ 7 | \method{support}{Binomial}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Binomial} object created by a call to \code{\link[=Binomial]{Binomial()}}.} 11 | 12 | \item{drop}{logical. Shoul the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Binomial distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Cauchy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Cauchy.R 3 | \name{support.Cauchy} 4 | \alias{support.Cauchy} 5 | \title{Return the support of the Cauchy distribution} 6 | \usage{ 7 | \method{support}{Cauchy}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Cauchy} object created by a call to \code{\link[=Cauchy]{Cauchy()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Cauchy distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.ChiSquare.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ChiSquare.R 3 | \name{support.ChiSquare} 4 | \alias{support.ChiSquare} 5 | \title{Return the support of the ChiSquare distribution} 6 | \usage{ 7 | \method{support}{ChiSquare}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{ChiSquare} object created by a call to \code{\link[=ChiSquare]{ChiSquare()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the ChiSquare distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Erlang.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Erlang.R 3 | \name{support.Erlang} 4 | \alias{support.Erlang} 5 | \title{Return the support of the Erlang distribution} 6 | \usage{ 7 | \method{support}{Erlang}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Erlang} object created by a call to \code{\link[=Erlang]{Erlang()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Erlang distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Exponential.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Exponential.R 3 | \name{support.Exponential} 4 | \alias{support.Exponential} 5 | \title{Return the support of the Exponential distribution} 6 | \usage{ 7 | \method{support}{Exponential}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Exponential} object created by a call to \code{\link[=Exponential]{Exponential()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Exponential distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.FisherF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/FisherF.R 3 | \name{support.FisherF} 4 | \alias{support.FisherF} 5 | \title{Return the support of the FisherF distribution} 6 | \usage{ 7 | \method{support}{FisherF}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{FisherF} object created by a call to \code{\link[=FisherF]{FisherF()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the FisherF distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Frechet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Frechet.R 3 | \name{support.Frechet} 4 | \alias{support.Frechet} 5 | \title{Return the support of the Frechet distribution} 6 | \usage{ 7 | \method{support}{Frechet}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Frechet} object created by a call to \code{\link[=Frechet]{Frechet()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | In case of a single distribution object, a numeric vector of length 2 18 | with the minimum and maximum value of the support (if \code{drop = TRUE}, default) 19 | or a \code{matrix} with 2 columns. In case of a vectorized distribution object, a 20 | matrix with 2 columns containing all minima and maxima. 21 | } 22 | \description{ 23 | Return the support of the Frechet distribution 24 | } 25 | -------------------------------------------------------------------------------- /man/support.GEV.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedExtremeValue.R 3 | \name{support.GEV} 4 | \alias{support.GEV} 5 | \title{Return the support of a GEV distribution} 6 | \usage{ 7 | \method{support}{GEV}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{GEV} object created by a call to \code{\link[=GEV]{GEV()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | In case of a single distribution object, a numeric vector of length 2 18 | with the minimum and maximum value of the support (if \code{drop = TRUE}, default) 19 | or a \code{matrix} with 2 columns. In case of a vectorized distribution object, a 20 | matrix with 2 columns containing all minima and maxima. 21 | } 22 | \description{ 23 | Return the support of a GEV distribution 24 | } 25 | -------------------------------------------------------------------------------- /man/support.GP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GeneralisedPareto.R 3 | \name{support.GP} 4 | \alias{support.GP} 5 | \title{Return the support of the GP distribution} 6 | \usage{ 7 | \method{support}{GP}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{GP} object created by a call to \code{\link[=GP]{GP()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | In case of a single distribution object, a numeric vector of length 2 18 | with the minimum and maximum value of the support (if \code{drop = TRUE}, default) 19 | or a \code{matrix} with 2 columns. In case of a vectorized distribution object, a 20 | matrix with 2 columns containing all minima and maxima. 21 | } 22 | \description{ 23 | Return the support of the GP distribution 24 | } 25 | -------------------------------------------------------------------------------- /man/support.Gamma.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gamma.R 3 | \name{support.Gamma} 4 | \alias{support.Gamma} 5 | \title{Return the support of the Gamma distribution} 6 | \usage{ 7 | \method{support}{Gamma}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Gamma} object created by a call to \code{\link[=Gamma]{Gamma()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Gamma distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Geometric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Geometric.R 3 | \name{support.Geometric} 4 | \alias{support.Geometric} 5 | \title{Return the support of the Geometric distribution} 6 | \usage{ 7 | \method{support}{Geometric}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Geometric} object created by a call to \code{\link[=Geometric]{Geometric()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Geometric distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Gumbel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Gumbel.R 3 | \name{support.Gumbel} 4 | \alias{support.Gumbel} 5 | \title{Return the support of the Gumbel distribution} 6 | \usage{ 7 | \method{support}{Gumbel}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Gumbel} object created by a call to \code{\link[=Gumbel]{Gumbel()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | In case of a single distribution object, a numeric vector of length 2 18 | with the minimum and maximum value of the support (if \code{drop = TRUE}, default) 19 | or a \code{matrix} with 2 columns. In case of a vectorized distribution object, a 20 | matrix with 2 columns containing all minima and maxima. 21 | } 22 | \description{ 23 | Return the support of the Gumbel distribution 24 | } 25 | -------------------------------------------------------------------------------- /man/support.HurdleNegativeBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/HurdleNegativeBinomial.R 3 | \name{support.HurdleNegativeBinomial} 4 | \alias{support.HurdleNegativeBinomial} 5 | \title{Return the support of the hurdle negative binomial distribution} 6 | \usage{ 7 | \method{support}{HurdleNegativeBinomial}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{HurdleNegativeBinomial} object created by a call to \code{\link[=HurdleNegativeBinomial]{HurdleNegativeBinomial()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the hurdle negative binomial distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.HurdlePoisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/HurdlePoisson.R 3 | \name{support.HurdlePoisson} 4 | \alias{support.HurdlePoisson} 5 | \title{Return the support of the hurdle Poisson distribution} 6 | \usage{ 7 | \method{support}{HurdlePoisson}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{HurdlePoisson} object created by a call to \code{\link[=HurdlePoisson]{HurdlePoisson()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the hurdle Poisson distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.HyperGeometric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/HyperGeometric.R 3 | \name{support.HyperGeometric} 4 | \alias{support.HyperGeometric} 5 | \title{Return the support of the HyperGeometric distribution} 6 | \usage{ 7 | \method{support}{HyperGeometric}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{HyperGeometric} object created by a call to \code{\link[=HyperGeometric]{HyperGeometric()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the HyperGeometric distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.LogNormal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/LogNormal.R 3 | \name{support.LogNormal} 4 | \alias{support.LogNormal} 5 | \title{Return the support of the LogNormal distribution} 6 | \usage{ 7 | \method{support}{LogNormal}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{LogNormal} object created by a call to \code{\link[=LogNormal]{LogNormal()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the LogNormal distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Logistic.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Logistic.R 3 | \name{support.Logistic} 4 | \alias{support.Logistic} 5 | \title{Return the support of the Logistic distribution} 6 | \usage{ 7 | \method{support}{Logistic}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Logistic} object created by a call to \code{\link[=Logistic]{Logistic()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Logistic distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.NegativeBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/NegativeBinomial.R 3 | \name{support.NegativeBinomial} 4 | \alias{support.NegativeBinomial} 5 | \title{Return the support of the NegativeBinomial distribution} 6 | \usage{ 7 | \method{support}{NegativeBinomial}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{NegativeBinomial} object created by a call to \code{\link[=NegativeBinomial]{NegativeBinomial()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the NegativeBinomial distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Normal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Normal.R 3 | \name{support.Normal} 4 | \alias{support.Normal} 5 | \title{Return the support of the Normal distribution} 6 | \usage{ 7 | \method{support}{Normal}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Normal} object created by a call to \code{\link[=Normal]{Normal()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | In case of a single distribution object, a numeric vector of length 2 18 | with the minimum and maximum value of the support (if \code{drop = TRUE}, default) 19 | or a \code{matrix} with 2 columns. In case of a vectorized distribution object, a 20 | matrix with 2 columns containing all minima and maxima. 21 | } 22 | \description{ 23 | Return the support of the Normal distribution 24 | } 25 | -------------------------------------------------------------------------------- /man/support.Poisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Poisson.R 3 | \name{support.Poisson} 4 | \alias{support.Poisson} 5 | \title{Return the support of the Poisson distribution} 6 | \usage{ 7 | \method{support}{Poisson}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Poisson} object created by a call to \code{\link[=Poisson]{Poisson()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Poisson distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.PoissonBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/PoissonBinomial.R 3 | \name{support.PoissonBinomial} 4 | \alias{support.PoissonBinomial} 5 | \title{Return the support of the PoissonBinomial distribution} 6 | \usage{ 7 | \method{support}{PoissonBinomial}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{A \code{PoissonBinomial} object created by a call to \code{\link[=PoissonBinomial]{PoissonBinomial()}}.} 11 | 12 | \item{drop}{logical. Shoul the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the PoissonBinomial distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/methods.R 3 | \name{support} 4 | \alias{support} 5 | \title{Return the support of a distribution} 6 | \usage{ 7 | support(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An object. The package provides methods for distribution 11 | objects such as those from \code{\link[=Normal]{Normal()}} or \code{\link[=Binomial]{Binomial()}} etc.} 12 | 13 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 14 | 15 | \item{...}{Arguments passed to methods. Unevaluated arguments will generate a warning to 16 | catch mispellings or other possible errors.} 17 | } 18 | \value{ 19 | A vector (or matrix) with two elements (or columns) indicating the 20 | range (minimum and maximum) of the support. 21 | } 22 | \description{ 23 | Generic function for computing the support interval (minimum and maximum) 24 | for a given probability distribution object. 25 | } 26 | \examples{ 27 | X <- Normal() 28 | support(X) 29 | Y <- Uniform(-1, 1:3) 30 | support(Y) 31 | } 32 | -------------------------------------------------------------------------------- /man/support.RevWeibull.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ReversedWeibull.R 3 | \name{support.RevWeibull} 4 | \alias{support.RevWeibull} 5 | \title{Return the support of the RevWeibull distribution} 6 | \usage{ 7 | \method{support}{RevWeibull}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{RevWeibull} object created by a call to \code{\link[=RevWeibull]{RevWeibull()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the RevWeibull distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.StudentsT.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/StudentsT.R 3 | \name{support.StudentsT} 4 | \alias{support.StudentsT} 5 | \title{Return the support of the StudentsT distribution} 6 | \usage{ 7 | \method{support}{StudentsT}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{StudentsT} object created by a call to \code{\link[=StudentsT]{StudentsT()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the StudentsT distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Tukey.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Tukey.R 3 | \name{support.Tukey} 4 | \alias{support.Tukey} 5 | \title{Return the support of the Tukey distribution} 6 | \usage{ 7 | \method{support}{Tukey}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Tukey} object created by a call to \code{\link[=Tukey]{Tukey()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Tukey distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Uniform.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Uniform.R 3 | \name{support.Uniform} 4 | \alias{support.Uniform} 5 | \title{Return the support of the Uniform distribution} 6 | \usage{ 7 | \method{support}{Uniform}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Uniform} object created by a call to \code{\link[=Uniform]{Uniform()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Uniform distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.Weibull.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Weibull.R 3 | \name{support.Weibull} 4 | \alias{support.Weibull} 5 | \title{Return the support of the Weibull distribution} 6 | \usage{ 7 | \method{support}{Weibull}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{Weibull} object created by a call to \code{\link[=Weibull]{Weibull()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the Weibull distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.ZINegativeBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ZINegativeBinomial.R 3 | \name{support.ZINegativeBinomial} 4 | \alias{support.ZINegativeBinomial} 5 | \title{Return the support of the zero-inflated negative binomial distribution} 6 | \usage{ 7 | \method{support}{ZINegativeBinomial}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{ZINegativeBinomial} object created by a call to \code{\link[=ZINegativeBinomial]{ZINegativeBinomial()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the zero-inflated negative binomial distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.ZIPoisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ZIPoisson.R 3 | \name{support.ZIPoisson} 4 | \alias{support.ZIPoisson} 5 | \title{Return the support of the zero-inflated Poisson distribution} 6 | \usage{ 7 | \method{support}{ZIPoisson}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{ZIPoisson} object created by a call to \code{\link[=ZIPoisson]{ZIPoisson()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the zero-inflated Poisson distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.ZTNegativeBinomial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ZTNegativeBinomial.R 3 | \name{support.ZTNegativeBinomial} 4 | \alias{support.ZTNegativeBinomial} 5 | \title{Return the support of the zero-truncated negative binomial distribution} 6 | \usage{ 7 | \method{support}{ZTNegativeBinomial}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{ZTNegativeBinomial} object created by a call to \code{\link[=ZTNegativeBinomial]{ZTNegativeBinomial()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the zero-truncated negative binomial distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/support.ZTPoisson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ZTPoisson.R 3 | \name{support.ZTPoisson} 4 | \alias{support.ZTPoisson} 5 | \title{Return the support of the zero-truncated Poisson distribution} 6 | \usage{ 7 | \method{support}{ZTPoisson}(d, drop = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{d}{An \code{ZTPoisson} object created by a call to \code{\link[=ZTPoisson]{ZTPoisson()}}.} 11 | 12 | \item{drop}{logical. Should the result be simplified to a vector if possible?} 13 | 14 | \item{...}{Currently not used.} 15 | } 16 | \value{ 17 | A vector of length 2 with the minimum and maximum value of the support. 18 | } 19 | \description{ 20 | Return the support of the zero-truncated Poisson distribution 21 | } 22 | -------------------------------------------------------------------------------- /man/variance.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/methods.R 3 | \name{variance} 4 | \alias{variance} 5 | \alias{skewness} 6 | \alias{kurtosis} 7 | \title{Compute the moments of a probability distribution} 8 | \usage{ 9 | variance(x, ...) 10 | 11 | skewness(x, ...) 12 | 13 | kurtosis(x, ...) 14 | } 15 | \arguments{ 16 | \item{x}{An object. The package provides methods for distribution 17 | objects such as those from \code{\link[=Normal]{Normal()}} or \code{\link[=Binomial]{Binomial()}} etc.} 18 | 19 | \item{...}{Arguments passed to methods. Unevaluated arguments will generate a warning to 20 | catch mispellings or other possible errors.} 21 | } 22 | \value{ 23 | Numeric vector with the values of the moments. 24 | } 25 | \description{ 26 | Generic functions for computing moments (variance, skewness, excess kurtosis) 27 | from probability distributions. 28 | } 29 | \details{ 30 | The functions \code{variance}, \code{skewness}, and \code{kurtosis} are new 31 | generic functions for computing moments of probability distributions such as 32 | those provided in this package. Additionally, the probability distributions 33 | from \pkg{distributions3} all have methods for the \code{\link[base]{mean}} 34 | generic. Moreover, quantiles can be computed with methods for 35 | \code{\link[stats]{quantile}}. For examples illustrating the usage with 36 | probability distribution objects, see the manual pages of the respective 37 | distributions, e.g., \code{\link{Normal}} or \code{\link{Binomial}} etc. 38 | } 39 | \seealso{ 40 | \code{\link[base]{mean}}, \code{\link[stats]{quantile}}, 41 | \code{\link{cdf}}, \code{\link{random}} 42 | } 43 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(distributions3) 3 | 4 | test_check("distributions3") 5 | -------------------------------------------------------------------------------- /tests/testthat/test-Multinomial.R: -------------------------------------------------------------------------------- 1 | test_that("print.Multinomial works", { 2 | expect_output(print(Multinomial(1, 0.5)), regexp = "Multinomial") 3 | }) 4 | 5 | test_that("likelihood.Multinomial and log_likelihood.Multinomial work correctly", { 6 | m <- Multinomial(1, 0.5) 7 | x <- c(1, 1, 0) 8 | 9 | expect_equal(likelihood(m, 1), 1) 10 | 11 | expect_equal(log_likelihood(m, 1), 0) 12 | }) 13 | 14 | test_that("random.Multinomial work correctly", { 15 | m <- Multinomial(2, 0.5) 16 | 17 | expect_length(random(m), 1) 18 | expect_length(random(m, 100), 100) 19 | # expect_length(random(m[-1], 1), 0) 20 | expect_length(random(m, 0), 0) 21 | expect_error(random(m, -2)) 22 | 23 | # consistent with base R, using the `length` as number of samples to draw 24 | # expect_length(random(m, c(1, 2, 3)), 3) 25 | # expect_length(random(m, cbind(1, 2, 3)), 3) 26 | # expect_length(random(m, rbind(1, 2, 3)), 3) 27 | }) 28 | -------------------------------------------------------------------------------- /tests/testthat/test-simulate.R: -------------------------------------------------------------------------------- 1 | test_that("simulate() methods work and return equivalent results", { 2 | ## Poisson GLM for FIFA 2018 goals data 3 | data("FIFA2018", package = "distributions3") 4 | m <- glm(goals ~ difference, data = FIFA2018, family = poisson) 5 | 6 | ## simulate new goals in various ways: 7 | ## simulate.glm 8 | set.seed(0) 9 | g_glm <- simulate(m, n = 3) 10 | 11 | ## simulate.default 12 | set.seed(0) 13 | g_default <- simulate.default(m, n = 3) 14 | 15 | ## simulate.distribution 16 | set.seed(0) 17 | g_distribution <- simulate(prodist(m), n = 3) 18 | 19 | ## rpois 20 | set.seed(0) 21 | g_manual <- as.data.frame(replicate(3, rpois(nobs(m), fitted(m)))) 22 | 23 | ## same results 24 | expect_equal(g_glm, g_default, ignore_attr = TRUE) 25 | expect_identical(g_default, g_distribution) 26 | expect_equal(g_glm, g_manual, ignore_attr = TRUE) 27 | }) 28 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | --------------------------------------------------------------------------------