algebraic.dist

R 패키지 메타데이터와 수집 신호를 모아 봅니다.

Packages / CRAN / algebraic.dist

algebraic.dist

v1.0.0
Repository CRANLicense GPL (>= 3)Lifecycle activeNeeds compilation no
DOI
10.32614/CRAN.package.algebraic.dist
Task views
Probability Distributions
Reverse imports
228

Core Signals

첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.

2
Task views
Probability Distributions
Reverse imports
228

Supported Backends

DESCRIPTION에서 감지한 backend 관련 package입니다.

0
backend package 신호가 없습니다.

Quick Facts

기본 메타데이터를 작은 카드와 토큰으로 압축합니다.

profile
Repository
CRAN
Version
1.0.0
License
GPL (>= 3)
Lifecycle
active
Needs compilation
no
Reverse imports
228
Last observed
2026-05-30
CRAN
cran.r-project.org/package=algebraic.dist

수집 소스별 패키지 정보

1개 소스
CRAN
1.0.0
2026-05-30
License
GPL (>= 3)
Depends
R (>= 3.5.0)
Imports
stats, mvtnorm, R6
Suggests
knitr, rmarkdown, testthat (>= 3.0.0)
Needs compilation
no
Reverse imports
228
Lifecycle
active
Last observed
2026-05-30 10:45:11

이 패키지가 의존하는 패키지

5개 표시전체 6개
PackageTypeSpec
mvtnorm
CRAN · 1.0.0 · 2026-05-30
Importsmvtnorm
R6
CRAN · 1.0.0 · 2026-05-30
ImportsR6
stats
CRAN · 1.0.0 · 2026-05-30
Importsstats
knitr
CRAN · 1.0.0 · 2026-05-30
Suggestsknitr
rmarkdown
CRAN · 1.0.0 · 2026-05-30
Suggestsrmarkdown
1 / 2

이 패키지를 쓰는 패키지

5개 표시전체 7개
PackageTypeSpec
algebraic.mle
2.0.2
CRAN · 2026-05-30
Importsalgebraic.dist (>= 0.9.1)
dist.structure
0.5.0
CRAN · 2026-05-30
Importsalgebraic.dist
flexhaz
0.5.2
CRAN · 2026-05-30
Importsalgebraic.dist
likelihood.model
1.0.1
CRAN · 2026-05-30
Importsalgebraic.dist
maskedhaz
0.1.0
CRAN · 2026-05-30
Importsalgebraic.dist
1 / 2

Reverse dependency summary

2 types
TypePackages
Imports6
Suggests1

패키지 페이지

Reverse imports
12
Reverse suggests
2
All links
44
Repository
CRAN
Version
1.0.0
Collected
2026-05-20 20:23:42
Package page
https://cran.r-project.org/web/packages/algebraic.dist/index.html
DOI
10.32614/CRAN.package.algebraic.dist
CRAN checks
https://cran.r-project.org/web/checks/check_results_algebraic.dist.html
README
https://cran.r-project.org/web/packages/algebraic.dist/readme/README.html
NEWS
https://cran.r-project.org/web/packages/algebraic.dist/news/news.html
Reference HTML
https://cran.r-project.org/web/packages/algebraic.dist/refman/algebraic.dist.html
Reference PDF
https://cran.r-project.org/web/packages/algebraic.dist/algebraic.dist.pdf
Source package
https://cran.r-project.org/src/contrib/algebraic.dist_1.0.0.tar.gz
Archive
https://CRAN.R-project.org/src/contrib/Archive/algebraic.dist
In views
Distributions
Page fields
Author
Alexander Towell [aut, cre]
BugReports
https://github.com/queelius/algebraic.dist/issues
CRAN Checks
algebraic.dist results
DOI
10.32614/CRAN.package.algebraic.dist
In Views
Distributions
License
GPL (≥ 3)
Maintainer
Alexander Towell <lex at metafunctor.com>
Materials
README , NEWS
NeedsCompilation
no
Old Sources
algebraic.dist archive
Package Source
algebraic.dist_1.0.0.tar.gz
Published
2026-03-18
Reference Manual
algebraic.dist.html , algebraic.dist.pdf
Reverse Imports
algebraic.mle , dist.structure , flexhaz , likelihood.model , maskedhaz , serieshaz
Reverse Suggests
maskedcauses
URL
https://github.com/queelius/algebraic.dist , https://queelius.github.io/algebraic.dist/
Version
1.0.0
Vignettes
Distribution Algebra with algebraic.dist ( source , R code ) algebraic.dist: Examples ( source , R code ) Multivariate and Mixture Distributions ( source , R code )
Windows Binaries
r-devel: algebraic.dist_1.0.0.zip , r-release: algebraic.dist_1.0.0.zip , r-oldrel: algebraic.dist_1.0.0.zip
MacOS Binaries
r-release (arm64): algebraic.dist_1.0.0.tgz , r-oldrel (arm64): algebraic.dist_1.0.0.tgz , r-release (x86_64): algebraic.dist_1.0.0.tgz , r-oldrel (x86_64): algebraic.dist_1.0.0.tgz
Version
1.0.0
Published
2026-03-18
DOI
10.32614/CRAN.package.algebraic.dist
Author
Alexander Towell [aut, cre]
Maintainer
Alexander Towell <lex at metafunctor.com>
BugReports
https://github.com/queelius/algebraic.dist/issues
License
GPL (≥ 3)
URL
https://github.com/queelius/algebraic.dist , https://queelius.github.io/algebraic.dist/
NeedsCompilation
no
Materials
README , NEWS
In Views
Distributions
CRAN Checks
algebraic.dist results
Reference Manual
algebraic.dist.html , algebraic.dist.pdf
Vignettes
Distribution Algebra with algebraic.dist ( source , R code ) algebraic.dist: Examples ( source , R code ) Multivariate and Mixture Distributions ( source , R code )
Package Source
algebraic.dist_1.0.0.tar.gz
Windows Binaries
r-devel: algebraic.dist_1.0.0.zip , r-release: algebraic.dist_1.0.0.zip , r-oldrel: algebraic.dist_1.0.0.zip
MacOS Binaries
r-release (arm64): algebraic.dist_1.0.0.tgz , r-oldrel (arm64): algebraic.dist_1.0.0.tgz , r-release (x86_64): algebraic.dist_1.0.0.tgz , r-oldrel (x86_64): algebraic.dist_1.0.0.tgz
Old Sources
algebraic.dist archive
Reverse Imports
algebraic.mle , dist.structure , flexhaz , likelihood.model , maskedhaz , serieshaz
Reverse Suggests
maskedcauses
Page sections 4
Documentation
Heading
Documentation
Links
[{"label":"algebraic.dist.html","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/refman/algebraic.dist.html"},{"label":"algebraic.dist.pdf","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/algebraic.dist.pdf"},{"label":"Distribution Algebra with algebraic.dist","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/vignettes/algebra.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/vignettes/algebra.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/vignettes/algebra.R"},{"label":"algebraic.dist: Examples","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/vignettes/example.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/vignettes/example.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/vignettes/example.R"},{"label":"Multivariate and Mixture Distributions","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/vignettes/multivariate.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/vignettes/multivariate.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.dist/vignettes/multivariate.R"}]
Text
Reference manual: algebraic.dist.html , algebraic.dist.pdf Vignettes: Distribution Algebra with algebraic.dist ( source , R code ) algebraic.dist: Examples ( source , R code ) Multivariate and Mixture Distributions ( source , R code )
Downloads
Heading
Downloads
Links
[{"label":"algebraic.dist_1.0.0.tar.gz","section":"","type":"","url":"https://cran.r-project.org/src/contrib/algebraic.dist_1.0.0.tar.gz"},{"label":"algebraic.dist_1.0.0.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.7/algebraic.dist_1.0.0.zip"},{"label":"algebraic.dist_1.0.0.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.6/algebraic.dist_1.0.0.zip"},{"label":"algebraic.dist_1.0.0.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.5/algebraic.dist_1.0.0.zip"},{"label":"algebraic.dist_1.0.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/sonoma-arm64/contrib/4.6/algebraic.dist_1.0.0.tgz"},{"label":"algebraic.dist_1.0.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/algebraic.dist_1.0.0.tgz"},{"label":"algebraic.dist_1.0.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.6/algebraic.dist_1.0.0.tgz"},{"label":"algebraic.dist_1.0.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.5/algebraic.dist_1.0.0.tgz"},{"label":"algebraic.dist archive","section":"","type":"","url":"https://CRAN.R-project.org/src/contrib/Archive/algebraic.dist"}]
Text
Package source: algebraic.dist_1.0.0.tar.gz Windows binaries: r-devel: algebraic.dist_1.0.0.zip , r-release: algebraic.dist_1.0.0.zip , r-oldrel: algebraic.dist_1.0.0.zip macOS binaries: r-release (arm64): algebraic.dist_1.0.0.tgz , r-oldrel (arm64): algebraic.dist_1.0.0.tgz , r-release (x86_64): algebraic.dist_1.0.0.tgz , r-oldrel (x86_64): algebraic.dist_1.0.0.tgz Old sources: algebraic.dist archive
Reverse dependencies
Heading
Reverse dependencies
Links
[{"label":"algebraic.mle","section":"","type":"","url":"https://cran.r-project.org/web/packages/algebraic.mle/index.html"},{"label":"dist.structure","section":"","type":"","url":"https://cran.r-project.org/web/packages/dist.structure/index.html"},{"label":"flexhaz","section":"","type":"","url":"https://cran.r-project.org/web/packages/flexhaz/index.html"},{"label":"likelihood.model","section":"","type":"","url":"https://cran.r-project.org/web/packages/likelihood.model/index.html"},{"label":"maskedhaz","section":"","type":"","url":"https://cran.r-project.org/web/packages/maskedhaz/index.html"},{"label":"serieshaz","section":"","type":"","url":"https://cran.r-project.org/web/packages/serieshaz/index.html"},{"label":"maskedcauses","section":"","type":"","url":"https://cran.r-project.org/web/packages/maskedcauses/index.html"}]
Text
Reverse imports: algebraic.mle , dist.structure , flexhaz , likelihood.model , maskedhaz , serieshaz Reverse suggests: maskedcauses
Linking
Heading
Linking
Links
[{"label":"https://CRAN.R-project.org/package=algebraic.dist","section":"","type":"","url":"https://CRAN.R-project.org/package=algebraic.dist"}]
Text
Please use the canonical form https://CRAN.R-project.org/package=algebraic.dist to link to this page.
Materials 2
Documentation 11
Vignettes 9
Downloads 9
All page links 44

패키지 문서 원문

4 artifacts
field
NEWS
CRAN · 1.0.0 · Materials · text/html · 8,500 · 2026-05-07
Title
NEWS
Label
NEWS
Text content
Text content
NEWS code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} algebraic.dist 0.9.1 New Generics as_dist() — S3 generic for converting objects (e.g., fitted models) into dist objects. Identity method for dist ; designed as an extension point for downstream packages Unified Fallback Layer realized_dist subclass of empirical_dist — preserves provenance (source distribution, sample count) when materializing via Monte Carlo ensure_realized() internal memoized entry point — all MC fallback methods now share cached samples (calling cdf(e) + density(e) on the same edist no longer draws independent samples) conditional.dist and rmap.dist now route through ensure_realized() for consistent provenance New Simplification Rules Uniform(a,b) + c → Uniform(a+c, b+c) (location shift) Uniform(a,b) - c → Uniform(a-c, b-c) (location shift) c * Uniform(a,b) → Uniform(min(ca,cb), max(ca,cb)) for c ≠ 0 c * Weibull(k,λ) → Weibull(k, c*λ) for c > 0 c * ChiSq(df) → Gamma(df/2, 1/(2c)) for c > 0 c * LogNormal(μ,σ) → LogNormal(μ+log(c), σ) for c > 0 LogNormal * LogNormal → LogNormal(μ₁+μ₂, √(σ₁²+σ₂²)) -Uniform(a,b) → Uniform(-b, -a) (unary negation) New Operators /.dist — Division operator: dist / scalar delegates to scalar multiplication rules; scalar / dist and dist / dist create edist MVN Algebra conditional.mvn — closed-form Schur complement conditioning with given_indices / given_values , or predicate-based MC fallback affine_transform(x, A, b) — compute AX + b for normal/MVN distributions (exact) Mixture Multivariate marginal.mixture — marginal of mixture is mixture of marginals (exact) conditional.mixture — Bayes’ rule weight update for mixture-of-MVN conditioning, with predicate-based MC fallback Limiting Distributions clt(base_dist) — CLT limiting distribution: Normal(0, Var) or MVN(0, Σ) lln(base_dist) — LLN degenerate limit: Normal(μ, 0) or MVN(μ, 0) delta_clt(base_dist, g, dg) — delta method with user-supplied derivative/Jacobian normal_approx(x) — moment-matching normal approximation of any distribution algebraic.dist 0.2.0 New Distributions gamma_dist(shape, rate) — Gamma distribution with hazard/survival functions weibull_dist(shape, scale) — Weibull distribution with closed-form hazard chi_squared(df) — Chi-squared distribution with hazard/survival functions uniform_dist(min, max) — Uniform distribution on [min, max] beta_dist(shape1, shape2) — Beta distribution on (0, 1) lognormal(meanlog, sdlog) — Log-normal distribution with hazard/survival poisson_dist(lambda) — Poisson distribution with exact expectation via truncated summation mixture(components, weights) — Mixture distributions with law of total variance New Operators and Algebra *.dist — Scalar multiplication ( c * dist , dist * c , dist * dist ) ^.dist — Power operator ( dist ^ n ) Math.dist — Group generic for exp() , log() , sqrt() , abs() , etc. Summary.dist — Group generic for sum() , prod() , min() , max() Extended +.dist and -.dist for numeric location shifts Simplification Rules c * Normal(mu, v) simplifies to Normal(c*mu, c^2*v) c * Gamma(a, r) simplifies to Gamma(a, r/c) for c > 0 c * Exponential(r) simplifies to Gamma(1, r/c) for c > 0 Normal(mu, v) + c simplifies to Normal(mu+c, v) Gamma(a1, r) + Gamma(a2, r) simplifies to Gamma(a1+a2, r) (same rate) Exp(r) + Exp(r) simplifies to Gamma(2, r) (same rate) ChiSq(d1) + ChiSq(d2) simplifies to ChiSq(d1+d2) Poisson(l1) + Poisson(l2) simplifies to Poisson(l1+l2) Normal(0,1)^2 simplifies to ChiSq(1) exp(Normal(mu, v)) simplifies to LogNormal(mu, sqrt(v)) log(LogNormal(ml, sl)) simplifies to Normal(ml, sl^2) min(Exp(r1), ..., Exp(rk)) simplifies to Exp(sum(r)) New Infrastructure realize() generic — materialize any distribution to empirical_dist by sampling Auto-fallback methods for edist : cdf , density , sup , conditional , rmap , inv_cdf countable_set R6 class for countably infinite support (Poisson) inv_cdf.empirical_dist — quantile function for empirical distributions Improvements Informative error messages in all constructors (replaced stopifnot ) format() methods for all distribution types Standardized print() methods delegating to format() Fixed vcov.exponential — was returning rate instead of 1/rate^2 Fixed sampler.edist crash when n=1 conditional.empirical_dist gives informative error on zero matches Zero-variance guard in expectation_data() CI computation algebraic.dist 0.1.0 Initial CRAN release. Features Core distribution types: normal , mvn , exponential , empirical_dist Expression distributions ( edist ) for lazy composition of distributions Algebraic operations ( + , - ) on distributions with automatic simplification Support classes: finite_set , interval for representing distribution domains Generic methods: sampler , mean , vcov , density , cdf , params Monte Carlo estimation for expectation , conditional , and rmap operations
field
README
CRAN · 1.0.0 · Materials · text/html · 12,794 · 2026-05-07
Title
README
Label
README
Text content
Text content
README code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { color: #008000; } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { color: #008000; font-weight: bold; } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ R package: algebraic.dist Installation Overview Distribution types Automatic simplification Multivariate operations Limiting distributions Quick example Documentation R package: algebraic.dist An algebra over probability distributions: compose, transform, and automatically simplify distribution expressions in R. Tags : probability distributions, distribution algebra, automatic simplification, multivariate normal, mixture models, CLT, delta method, Monte Carlo, R, statistics Installation Install the stable release from CRAN: install.packages ( "algebraic.dist" ) Or install the development version from GitHub: # install.packages("devtools") devtools :: install_github ( "queelius/algebraic.dist" ) Overview algebraic.dist lets you build and manipulate probability distributions as first-class R objects. Algebraic operations ( + , - , * , / , ^ , exp , log , min , max , …) on distribution objects automatically simplify to closed-form distributions when mathematical identities apply, and fall back to lazy Monte Carlo expressions ( edist ) otherwise. Distribution types Normal, exponential, gamma, Weibull, chi-squared, uniform, beta, log-normal, Poisson, multivariate normal (MVN), mixture, and empirical distributions. Automatic simplification Over 20 built-in rules, including: Normal + Normal → Normal Gamma + Gamma (same rate) → Gamma exp(Normal) → LogNormal Normal(0,1)^2 → ChiSq(1) min(Exp, ..., Exp) → Exp c * Uniform(a,b) → Uniform When no rule matches, the result is a lazy edist that samples from its components and evaluates the expression on demand. Multivariate operations MVN conditioning : closed-form Schur complement via conditional() Affine transforms : affine_transform(x, A, b) for exact linear maps Mixture conditioning : Bayesian weight updates via Bayes’ rule Marginals : exact for MVN and mixture distributions Limiting distributions clt() — Central Limit Theorem lln() — Law of Large Numbers delta_clt() — delta method for transformed means normal_approx() — moment-matching normal approximation Quick example library (algebraic.dist) # Sum of normals simplifies to a normal x <- normal ( 1 , 4 ) y <- normal ( 2 , 5 ) z <- x + y z #> Normal distribution (mu = 3, var = 9) # exp of a normal simplifies to log-normal w <- exp ( normal ( 0 , 1 )) w #> Log-normal distribution (meanlog = 0, sdlog = 1) # Gamma addition with matching rates g <- gamma_dist ( 3 , 2 ) + gamma_dist ( 4 , 2 ) g #> Gamma distribution (shape = 7, rate = 2) # CLT: the standardized sample mean converges to N(0, 1) clt ( normal ( 5 , 4 )) #> Normal distribution (mu = 0, var = 4) Documentation The full documentation is available at https://queelius.github.io/algebraic.dist/ . Vignettes: Getting started — core distribution objects, sampling, and basic operations Distribution algebra — simplification rules, limiting distributions, and the CLT/LLN/delta method Multivariate operations — MVN conditioning, affine transforms, and Gaussian mixture models
reference_manual_html
Reference manual HTML
CRAN · 1.0.0 · Documentation · text/html · 263,372 · 2026-05-07
Title
Help for package algebraic.dist
Label
Reference manual HTML
Text content
Text content
Help for package algebraic.dist const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {algebraic.dist} Contents algebraic.dist-package *.dist +.dist -.dist /.dist Math.dist Summary.dist ^.dist affine_transform as_dist beta_dist cdf cdf.beta_dist cdf.chi_squared cdf.edist cdf.empirical_dist cdf.exponential cdf.gamma_dist cdf.lognormal cdf.mixture cdf.mvn cdf.normal cdf.poisson_dist cdf.uniform_dist cdf.weibull_dist chi_squared clt conditional conditional.dist conditional.edist conditional.empirical_dist conditional.mixture conditional.mvn countable_set delta_clt density.beta_dist density.chi_squared density.edist density.empirical_dist density.exponential density.gamma_dist density.lognormal density.mixture density.mvn density.normal density.poisson_dist density.uniform_dist density.weibull_dist dim.beta_dist dim.chi_squared dim.countable_set dim.edist dim.empirical_dist dim.exponential dim.finite_set dim.gamma_dist dim.interval dim.lognormal dim.mixture dim.mvn dim.normal dim.poisson_dist dim.uniform_dist dim.weibull_dist edist empirical_dist ensure_realized expectation expectation.dist expectation.empirical_dist expectation.poisson_dist expectation.univariate_dist expectation_data exponential finite_set format.beta_dist format.chi_squared format.edist format.empirical_dist format.exponential format.gamma_dist format.lognormal format.mixture format.mvn format.normal format.poisson_dist format.realized_dist format.uniform_dist format.weibull_dist gamma_dist has has.countable_set has.finite_set has.interval hazard.chi_squared hazard.continuous_dist hazard.exponential hazard.gamma_dist hazard.lognormal hazard.weibull_dist infimum infimum.countable_set infimum.finite_set infimum.interval interval inv_cdf inv_cdf.beta_dist inv_cdf.chi_squared inv_cdf.edist inv_cdf.empirical_dist inv_cdf.exponential inv_cdf.gamma_dist inv_cdf.lognormal inv_cdf.normal inv_cdf.poisson_dist inv_cdf.uniform_dist inv_cdf.weibull_dist is_beta_dist is_chi_squared is_dist is_edist is_empirical_dist is_exponential is_gamma_dist is_lognormal is_mixture is_mvn is_normal is_poisson_dist is_realized_dist is_uniform_dist is_weibull_dist lln lognormal marginal marginal.empirical_dist marginal.mixture marginal.mvn mean.beta_dist mean.chi_squared mean.edist mean.empirical_dist mean.exponential mean.gamma_dist mean.lognormal mean.mixture mean.mvn mean.normal mean.poisson_dist mean.uniform_dist mean.univariate_dist mean.weibull_dist mixture mvn nobs.empirical_dist normal normal_approx nparams nparams.empirical_dist nparams.mixture obs obs.empirical_dist params params.beta_dist params.chi_squared params.edist params.empirical_dist params.exponential params.gamma_dist params.lognormal params.mixture params.mvn params.normal params.poisson_dist params.uniform_dist params.weibull_dist poisson_dist print.beta_dist print.chi_squared print.edist print.empirical_dist print.exponential print.gamma_dist print.interval print.lognormal print.mixture print.mvn print.normal print.poisson_dist print.realized_dist print.summary_dist print.uniform_dist print.weibull_dist realize realized_dist rmap rmap.dist rmap.edist rmap.empirical_dist rmap.mvn sample_mvn_region sampler sampler.beta_dist sampler.chi_squared sampler.default sampler.edist sampler.empirical_dist sampler.exponential sampler.gamma_dist sampler.lognormal sampler.mixture sampler.mvn sampler.normal sampler.poisson_dist sampler.uniform_dist sampler.weibull_dist simplify simplify.dist simplify.edist summary.dist summary_dist sup sup.beta_dist sup.chi_squared sup.edist sup.empirical_dist sup.exponential sup.gamma_dist sup.lognormal sup.mixture sup.mvn sup.normal sup.poisson_dist sup.uniform_dist sup.weibull_dist supremum supremum.countable_set supremum.finite_set supremum.interval surv.chi_squared surv.continuous_dist surv.exponential surv.gamma_dist surv.lognormal surv.weibull_dist uniform_dist vcov.beta_dist vcov.chi_squared vcov.default vcov.edist vcov.empirical_dist vcov.exponential vcov.gamma_dist vcov.lognormal vcov.mixture vcov.mvn vcov.normal vcov.poisson_dist vcov.uniform_dist vcov.univariate_dist vcov.weibull_dist weibull_dist Title: Algebra over Probability Distributions Version: 1.0.0 Description: Provides an algebra over probability distributions enabling composition, sampling, and automatic simplification to closed forms. Supports normal, exponential, gamma, Weibull, chi-squared, uniform, beta, log-normal, Poisson, multivariate normal, empirical, and mixture distributions with algebraic operators (addition, subtraction, multiplication, division, power, exp, log, min, max) that automatically simplify when mathematical identities apply. Includes closed-form MVN conditioning (Schur complement), affine transformations, mixture marginals/conditionals (Bayes rule), and limiting distribution builders (CLT, LLN, delta method). Uses S3 classes for distributions and R6 for support objects. License: GPL (≥ 3) Encoding: UTF-8 RoxygenNote: 7.3.3 Suggests: knitr, rmarkdown, testthat (≥ 3.0.0) Config/testthat/edition: 3 Imports: stats, mvtnorm, R6 Depends: R (≥ 3.5.0) VignetteBuilder: knitr URL: https://github.com/queelius/algebraic.dist , https://queelius.github.io/algebraic.dist/ BugReports: https://github.com/queelius/algebraic.dist/issues NeedsCompilation: no Packaged: 2026-03-17 17:48:01 UTC; spinoza Author: Alexander Towell [aut, cre] Maintainer: Alexander Towell <lex@metafunctor.com> Repository: CRAN Date/Publication: 2026-03-18 06:13:20 UTC algebraic.dist: Algebra over Probability Distributions Description Provides an algebra over probability distributions enabling composition, sampling, and automatic simplification to closed forms. Supports normal, exponential, gamma, Weibull, chi-squared, uniform, beta, log-normal, Poisson, multivariate normal, empirical, and mixture distributions with algebraic operators (addition, subtraction, multiplication, division, power, exp, log, min, max) that automatically simplify when mathematical identities apply. Includes closed-form MVN conditioning (Schur complement), affine transformations, mixture marginals/conditionals (Bayes rule), and limiting distribution builders (CLT, LLN, delta method). Uses S3 classes for distributions and R6 for support objects. Author(s) Maintainer : Alexander Towell lex@metafunctor.com ( ORCID ) See Also Useful links: https://github.com/queelius/algebraic.dist https://queelius.github.io/algebraic.dist/ Report bugs at https://github.com/queelius/algebraic.dist/issues Multiplication of distribution objects. Description Handles scalar * dist, dist * scalar, and dist * dist. Usage ## S3 method for class 'dist' x * y Arguments x first operand y second operand Value A simplified distribution or edist Examples # Scalar multiplication simplifies for normal z <- 2 * normal(0, 1) z # Normal(mu = 0, var = 4) # Product of two distributions yields an edist w <- normal(0, 1) * exponential(1) is_edist(w) # TRUE Method for adding dist objects, or shifting a distribution by a scalar. Description Creates an expression distribution and automatically simplifies to closed form when possible (e.g., normal + normal = normal, normal + scalar = normal with shifted mean). Usage ## S3 method for class 'dist' x + y Arguments x A dist object or numeric scalar y A dist object or numeric scalar Value A simplified distribution or edist if no closed form exists Examples # Sum of two normals simplifies to a normal z <- normal(0, 1) + normal(2, 3) z # Normal(mu = 2, var = 4) # Shift a distribution by a constant normal(0, 1) + 5 # Normal(mu = 5, var = 1) Method for negation or subtraction of dist objects. Description Unary: returns negated distribution (e.g., -N(mu, var) = N(-mu, var)) Binary: creates expression distribution and simplifies to closed form when possible (e.g., normal - normal = normal,
section
algebraic.dist.pdf
CRAN · 1.0.0 · Documentation · application/pdf · 429,118 · 2026-05-07
Title
algebraic.dist.pdf
Label
algebraic.dist.pdf

Reference for algebraic.dist (1.0.0)

80개 topic
*.dist
Multiplication of distribution objects.
CRAN · 1.0.0 · algebraic.dist/man/times-.dist.Rd · 2026-05-07

Handles scalar * dist, dist * scalar, and dist * dist.

Aliases
*.dist
Usage
*dist(x, y)
Arguments
x
first operand
y
second operand
Value
A simplified distribution or edist
Examples
# Scalar multiplication simplifies for normal z <- 2 * normal(0, 1) z # Normal(mu = 0, var = 4) # Product of two distributions yields an edist w <- normal(0, 1) * exponential(1) is_edist(w) # TRUE
+.dist
Method for adding dist objects, or shifting a distribution by a scalar.
CRAN · 1.0.0 · algebraic.dist/man/plus-.dist.Rd · 2026-05-07

Creates an expression distribution and automatically simplifies to closed form when possible (e.g., normal + normal = normal, normal + scalar = normal with shifted mean).

Aliases
+.dist
Usage
+dist(x, y)
Arguments
x
A dist object or numeric scalar
y
A dist object or numeric scalar
Value
A simplified distribution or edist if no closed form exists
Examples
# Sum of two normals simplifies to a normal z <- normal(0, 1) + normal(2, 3) z # Normal(mu = 2, var = 4) # Shift a distribution by a constant normal(0, 1) + 5 # Normal(mu = 5, var = 1)
-.dist
Method for negation or subtraction of dist objects.
CRAN · 1.0.0 · algebraic.dist/man/dot-dist.Rd · 2026-05-07

Unary: returns negated distribution (e.g., -N(mu, var) = N(-mu, var)) Binary: creates expression distribution and simplifies to closed form when possible (e.g., normal - normal = normal, normal - scalar = normal).

Aliases
-.dist
Usage
-dist(x, y)
Arguments
x
A dist object or numeric scalar
y
A dist object or numeric scalar (optional for unary negation)
Value
A simplified distribution or edist if no closed form exists
Examples
# Difference of normals simplifies to a normal z <- normal(5, 2) - normal(1, 3) z # Normal(mu = 4, var = 5) # Unary negation -normal(3, 1) # Normal(mu = -3, var = 1)
/.dist
Division of distribution objects.
CRAN · 1.0.0 · algebraic.dist/man/slash-.dist.Rd · 2026-05-07

Handles dist / scalar (delegates to dist * (1/scalar)), scalar / dist, and dist / dist.

Aliases
/.dist
Usage
/dist(x, y)
Arguments
x
first operand
y
second operand
Value
A simplified distribution or edist
Examples
# Division by scalar reuses multiplication rule z <- normal(0, 4) / 2 z # Normal(mu = 0, var = 1)
Math.dist
Math group generic for distribution objects.
CRAN · 1.0.0 · algebraic.dist/man/Math.dist.Rd · 2026-05-07

Handles exp(), log(), sqrt(), abs(), cos(), sin(), etc.

Aliases
Math.dist
Usage
Mathdist(x, ...)
Arguments
x
a dist object
...
additional arguments
Value
A simplified distribution or edist
Examples
# exp(Normal) simplifies to LogNormal z <- exp(normal(0, 1)) z # sqrt of a distribution (no closed-form rule, remains edist) w <- sqrt(exponential(1)) is_edist(w) # TRUE
Summary.dist
Summary group generic for distribution objects.
CRAN · 1.0.0 · algebraic.dist/man/dist_summary_group.Rd · 2026-05-07

Handles sum(), prod(), min(), max() of distributions.

Aliases
Summary.dist
Usage
Summarydist(..., na.rm = FALSE)
Arguments
...
dist objects
na.rm
ignored
Value
A simplified distribution or edist
Examples
# sum() reduces via + operator z <- sum(normal(0, 1), normal(2, 3)) z # Normal(mu = 2, var = 4) # min() of exponentials simplifies w <- min(exponential(1), exponential(2)) w # Exponential(rate = 3)
^.dist
Power operator for distribution objects.
CRAN · 1.0.0 · algebraic.dist/man/pow-.dist.Rd · 2026-05-07

Power operator for distribution objects.

Aliases
^.dist
Usage
^dist(x, y)
Arguments
x
a dist object (base)
y
a numeric scalar (exponent)
Value
A simplified distribution or edist
Examples
# Standard normal squared yields chi-squared(1) z <- normal(0, 1)^2 z
affine_transform
Affine transformation of a normal or multivariate normal distribution.
CRAN · 1.0.0 · algebraic.dist/man/affine_transform.Rd · 2026-05-07

Computes the distribution of AX + b where X MVN(, ). The result is MVN(A + b, A A^T).

Aliases
affine_transform
Usage
affine_transform(x, A, b = NULL)
Arguments
x
A normal or mvn distribution object.
A
A numeric matrix (or scalar for univariate).
b
An optional numeric vector (or scalar) for the offset. Default is a zero vector.
Details
For a univariate normal, scalars A and b are promoted to 1x1 matrices and scalar internally. Returns a normal if the result is 1-dimensional.
Value
A normal or mvn distribution.
Examples
X <- mvn(c(0, 0), diag(2)) # Project to first component via 1x2 matrix Y <- affine_transform(X, A = matrix(c(1, 0), 1, 2), b = 5) mean(Y) # Scale a univariate normal Z <- affine_transform(normal(0, 1), A = 3, b = 2) mean(Z) vcov(Z)
algebraic.dist-package
algebraic.dist: Algebra over Probability Distributions
CRAN · 1.0.0 · package · algebraic.dist/man/algebraic.dist-package.Rd · 2026-05-07

Provides an algebra over probability distributions enabling composition, sampling, and automatic simplification to closed forms. Supports normal, exponential, gamma, Weibull, chi-squared, uniform, beta, log-normal, Poisson, multivariate normal, empirical, and mixture distributions with algebraic operators (addition, subtraction, multiplication, division, power, exp, log, min, max) that automatically simplify when mathematical identities apply. Includes closed-form MVN conditioning (Schur complement), affine transformations, mixture marginals/conditionals (Bayes rule), and limiting distribution builders (CLT, LLN, delta method). Uses S3 classes for distributions and R6 for support objects.

Aliases
algebraic.distalgebraic.dist-package
Keywords
internal
See also
Useful links: https://github.com/queelius/algebraic.dist https://queelius.github.io/algebraic.dist/ Report bugs at https://github.com/queelius/algebraic.dist/issues
Author
Maintainer: Alexander Towell lex@metafunctor.com (https://orcid.org/0000-0001-6443-9897ORCID)
as_dist
Convert an object to a probability distribution.
CRAN · 1.0.0 · algebraic.dist/man/as_dist.Rd · 2026-05-07

Generic method for converting objects (such as fitted models) into distribution objects from the algebraic.dist package.

Aliases
as_distas_dist.dist
Usage
as_dist(x, ...) as_distdist(x, ...)
Arguments
x
The object to convert to a distribution.
...
Additional arguments to pass to methods.
Value
A dist object.
Examples
# Identity for existing distributions d <- normal(0, 1) identical(as_dist(d), d)
beta_dist
Construct a beta distribution object.
CRAN · 1.0.0 · algebraic.dist/man/beta_dist.Rd · 2026-05-07

Creates an S3 object representing a beta distribution with shape parameters shape1 and shape2. The PDF on (0, 1) is f(x) = x^a-1(1-x)^b-1B(a,b) where a = shape1, b = shape2, and B(a,b) is the beta function.

Aliases
beta_dist
Usage
beta_dist(shape1, shape2)
Arguments
shape1
First shape parameter, must be a positive scalar.
shape2
Second shape parameter, must be a positive scalar.
Value
A beta_dist object with classes c("beta_dist", "univariate_dist", "continuous_dist", "dist").
Examples
x <- beta_dist(shape1 = 2, shape2 = 5) mean(x) vcov(x) format(x)
cdf
Generic method for obtaining the cdf of an object.
CRAN · 1.0.0 · algebraic.dist/man/cdf.Rd · 2026-05-07

Generic method for obtaining the cdf of an object.

Aliases
cdf
Usage
cdf(x, ...)
Arguments
x
The object to obtain the cdf of.
...
Additional arguments to pass.
Value
A function computing the cumulative distribution function.
Examples
x <- normal(0, 1) F <- cdf(x) F(0) # 0.5 (median of standard normal) F(1.96) # approximately 0.975
cdf.beta_dist
Cumulative distribution function for a beta distribution.
CRAN · 1.0.0 · algebraic.dist/man/cdf.beta_dist.Rd · 2026-05-07

Returns a function that evaluates the beta CDF at given points.

Aliases
cdf.beta_dist
Usage
cdfbeta_dist(x, ...)
Arguments
x
A beta_dist object.
...
Additional arguments (not used).
Value
A function function(q, log.p = FALSE, ...) returning the CDF (or log-CDF) at q.
Examples
x <- beta_dist(2, 5) F <- cdf(x) F(0.3) F(0.5)
cdf.chi_squared
Method for obtaining the cdf of a chi_squared object.
CRAN · 1.0.0 · algebraic.dist/man/cdf.chi_squared.Rd · 2026-05-07

Method for obtaining the cdf of a chi_squared object.

Aliases
cdf.chi_squared
Usage
cdfchi_squared(x, ...)
Arguments
x
The chi_squared object
...
Additional arguments (not used)
Value
A function that computes the cdf at point(s) t
Examples
x <- chi_squared(5) F <- cdf(x) F(5) F(10)
cdf.edist
CDF for expression distributions.
CRAN · 1.0.0 · algebraic.dist/man/cdf.edist.Rd · 2026-05-07

Falls back to realize to materialize the distribution as an empirical_dist, then delegates to cdf.empirical_dist.

Aliases
cdf.edist
Usage
cdfedist(x, ...)
Arguments
x
An edist object.
...
Additional arguments forwarded to cdf.empirical_dist.
Value
A function computing the empirical CDF.
Examples
set.seed(1) z <- normal(0, 1) * exponential(1) Fz <- cdf(z) Fz(0)
cdf.empirical_dist
Method for obtaining the cdf of empirical_dist object x.
CRAN · 1.0.0 · algebraic.dist/man/cdf.empirical_dist.Rd · 2026-05-07

If x is a multivariate empirical distribution, this function will throw an error. It's only defined for univariate empirical distributions.

Aliases
cdf.empirical_dist
Usage
cdfempirical_dist(x, ...)
Arguments
x
The empirical distribution object.
...
Additional arguments to pass (not used))
Value
A function that takes a numeric vector t and returns the empirical cdf of x evaluated at t.
Examples
ed <- empirical_dist(c(1, 2, 3, 4, 5)) Fx <- cdf(ed) Fx(3) # 0.6 Fx(c(1, 5)) # 0.2, 1.0
cdf.exponential
Method to obtain the cdf of an exponential object.
CRAN · 1.0.0 · algebraic.dist/man/cdf.exponential.Rd · 2026-05-07

Method to obtain the cdf of an exponential object.

Aliases
cdf.exponential
Usage
cdfexponential(x, ...)
Arguments
x
The object to obtain the cdf of
...
Additional arguments (not used)
Value
A function function(q, lower.tail = TRUE, log.p = FALSE, ...) that computes the cdf (or log-cdf) of the exponential distribution.
Examples
x <- exponential(rate = 1) F <- cdf(x) F(1) F(2)
cdf.gamma_dist
Method for obtaining the cdf of a gamma_dist object.
CRAN · 1.0.0 · algebraic.dist/man/cdf.gamma_dist.Rd · 2026-05-07

Method for obtaining the cdf of a gamma_dist object.

Aliases
cdf.gamma_dist
Usage
cdfgamma_dist(x, ...)
Arguments
x
The gamma_dist object
...
Additional arguments (not used)
Value
A function that computes the cdf at point(s) t
Examples
x <- gamma_dist(shape = 2, rate = 1) F <- cdf(x) F(1) F(2)
cdf.lognormal
Cumulative distribution function for a log-normal distribution.
CRAN · 1.0.0 · algebraic.dist/man/cdf.lognormal.Rd · 2026-05-07

Returns a function that evaluates the log-normal CDF at given points.

Aliases
cdf.lognormal
Usage
cdflognormal(x, ...)
Arguments
x
A lognormal object.
...
Additional arguments (not used).
Value
A function function(q, log.p = FALSE, ...) returning the CDF (or log-CDF) at q.
Examples
x <- lognormal(0, 1) F <- cdf(x) F(1) F(2)
cdf.mixture
Cumulative distribution function for a mixture distribution.
CRAN · 1.0.0 · algebraic.dist/man/cdf.mixture.Rd · 2026-05-07

Returns a function that evaluates the mixture CDF at given points. The mixture CDF is F(x) = _k w_k F_k(x).

Aliases
cdf.mixture
Usage
cdfmixture(x, ...)
Arguments
x
A mixture object.
...
Additional arguments (not used).
Value
A function function(q, ...) returning the CDF at q.
Examples
m <- mixture(list(normal(0, 1), normal(5, 1)), c(0.5, 0.5)) F <- cdf(m) F(0) F(5)
cdf.mvn
Method for obtaining the CDF of a mvn object.
CRAN · 1.0.0 · algebraic.dist/man/cdf.mvn.Rd · 2026-05-07

Method for obtaining the CDF of a mvn object.

Aliases
cdf.mvn
Usage
cdfmvn(x, ...)
Arguments
x
The object to obtain the CDF of
...
Additional arguments to pass (not used)
Value
A function computing the multivariate normal CDF.
Examples
X <- mvn(c(0, 0), diag(2)) F <- cdf(X) F(c(0, 0))
cdf.normal
Method for obtaining the cdf of an normal object.
CRAN · 1.0.0 · algebraic.dist/man/cdf.normal.Rd · 2026-05-07

Method for obtaining the cdf of an normal object.

Aliases
cdf.normal
Usage
cdfnormal(x, ...)
Arguments
x
The object to obtain the cdf of
...
Additional arguments to pass (not used)
Value
A function function(q, lower.tail = TRUE, log.p = FALSE, ...) that computes the cdf (or log-cdf) of the normal distribution at q.
Examples
x <- normal(0, 1) F <- cdf(x) F(0) F(1.96)
cdf.poisson_dist
Cumulative distribution function for a Poisson distribution.
CRAN · 1.0.0 · algebraic.dist/man/cdf.poisson_dist.Rd · 2026-05-07

Returns a function that evaluates the Poisson CDF at given points.

Aliases
cdf.poisson_dist
Usage
cdfpoisson_dist(x, ...)
Arguments
x
A poisson_dist object.
...
Additional arguments (not used).
Value
A function function(q, log.p = FALSE, ...) returning the CDF (or log-CDF) at q.
Examples
x <- poisson_dist(5) F <- cdf(x) F(5) F(10)
cdf.uniform_dist
Cumulative distribution function for a uniform distribution.
CRAN · 1.0.0 · algebraic.dist/man/cdf.uniform_dist.Rd · 2026-05-07

Returns a function that evaluates the uniform CDF at given points.

Aliases
cdf.uniform_dist
Usage
cdfuniform_dist(x, ...)
Arguments
x
A uniform_dist object.
...
Additional arguments (not used).
Value
A function function(q, log.p = FALSE, ...) returning the CDF (or log-CDF) at q.
Examples
x <- uniform_dist(0, 10) F <- cdf(x) F(5) F(10)
cdf.weibull_dist
Cumulative distribution function for a Weibull distribution.
CRAN · 1.0.0 · algebraic.dist/man/cdf.weibull_dist.Rd · 2026-05-07

Returns a function that evaluates the Weibull CDF at given points.

Aliases
cdf.weibull_dist
Usage
cdfweibull_dist(x, ...)
Arguments
x
A weibull_dist object.
...
Additional arguments (not used).
Value
A function function(q, log.p = FALSE, ...) returning the CDF (or log-CDF) at q.
Examples
x <- weibull_dist(shape = 2, scale = 3) F <- cdf(x) F(1) F(3)
chi_squared
Construct a chi-squared distribution object.
CRAN · 1.0.0 · algebraic.dist/man/chi_squared.Rd · 2026-05-07

Construct a chi-squared distribution object.

Aliases
chi_squared
Usage
chi_squared(df)
Arguments
df
Degrees of freedom (positive scalar)
Value
A chi_squared object
Examples
x <- chi_squared(df = 5) mean(x) vcov(x) format(x)
clt
Central Limit Theorem Limiting Distribution
CRAN · 1.0.0 · algebraic.dist/man/clt.Rd · 2026-05-07

Returns the limiting distribution of the standardized sample mean n(X_n - ) under the Central Limit Theorem. For a univariate distribution with variance ^2, this is N(0, ^2). For a multivariate distribution with covariance matrix , this is MVN(0, ).

Aliases
clt
Usage
clt(base_dist)
Arguments
base_dist
A dist object representing the base distribution.
Value
A normal or mvn distribution representing the CLT limiting distribution.
Examples
# CLT for Exp(2): sqrt(n)(Xbar - 1/2) -> N(0, 1/4) x <- exponential(rate = 2) z <- clt(x) mean(z) vcov(z)
conditional
Generic method for obtaining the conditional distribution of a distribution object x given condition P.
CRAN · 1.0.0 · algebraic.dist/man/conditional.Rd · 2026-05-07

Generic method for obtaining the conditional distribution of a distribution object x given condition P.

Aliases
conditional
Usage
conditional(x, P, ...)
Arguments
x
The empirical distribution object.
P
The predicate function to condition x on
...
additional arguments to pass into P
Value
A distribution object for the conditional distribution.
Examples
d <- empirical_dist(1:100) # condition on values greater than 50 d_gt50 <- conditional(d, function(x) x > 50) mean(d_gt50)
conditional.dist
Method for obtaining the condition distribution, x | P(x), of dist object x.
CRAN · 1.0.0 · algebraic.dist/man/conditional.dist.Rd · 2026-05-07

Falls back to MC: materializes x via ensure_realized() and then conditions on the resulting empirical distribution.

Aliases
conditional.dist
Usage
conditionaldist(x, P, n = 10000L, ...)
Arguments
x
The distribution object.
P
The predicate function to condition the distribution on
n
The number of samples to generate for the MC estimate of the conditional distribution x | P. Defaults to 10000.
...
additional arguments to pass into P.
Value
An empirical_dist approximating the conditional distribution.
Examples
set.seed(1) x <- exponential(1) # Condition on X > 2 x_gt2 <- conditional(x, function(t) t > 2) mean(x_gt2)
conditional.edist
Conditional distribution for expression distributions.
CRAN · 1.0.0 · algebraic.dist/man/conditional.edist.Rd · 2026-05-07

Falls back to realize and delegates to conditional.empirical_dist.

Aliases
conditional.edist
Usage
conditionaledist(x, P, ...)
Arguments
x
An edist object.
P
Predicate function to condition on.
...
Additional arguments forwarded to the predicate P.
Value
A conditional empirical_dist.
Examples
set.seed(1) z <- normal(0, 1) + exponential(1) z_pos <- conditional(z, function(t) t > 2) mean(z_pos)
conditional.empirical_dist
Method for obtaining the condition distribution, x | P(x), of empirical_dist object x.
CRAN · 1.0.0 · algebraic.dist/man/conditional.empirical_dist.Rd · 2026-05-07

In other words, we condition the data on the predicate function. In order to do so, we simply remove all rows from the data that do not satisfy the predicate P. For instance, if we have a 2-dimensional distribution, and we want to condition on the first dimension being greater than the second dimension, we would do the following:

Aliases
conditional.empirical_dist
Usage
conditionalempirical_dist(x, P, ...)
Arguments
x
The empirical distribution object.
P
The predicate function to condition the data on.
...
additional arguments to pass into P.
Details
html<div class="sourceCode r">x_cond <- conditional(x, function(d) d[1] > d[2]) html</div> This would return a new empirical distribution object with the same dimensionality as x, but with all rows where the first dimension is less than or equal to the second dimension removed.
Value
An empirical_dist containing only rows satisfying P.
Examples
mat <- matrix(c(1, 5, 2, 3, 4, 1, 6, 2), ncol = 2) ed <- empirical_dist(mat) # Condition on first column being greater than second ed_cond <- conditional(ed, function(d) d[1] > d[2]) nobs(ed_cond)
conditional.mixture
Conditional distribution of a mixture.
CRAN · 1.0.0 · algebraic.dist/man/conditional.mixture.Rd · 2026-05-07

For a mixture of distributions that support closed-form conditioning (e.g. MVN), uses Bayes' rule to update the mixing weights: w_k' w_k f_k(x_given) where f_k is the marginal density of component k at the observed values. The component conditionals are computed via conditional(component_k, given_indices = ..., given_values = ...).

Aliases
conditional.mixture
Usage
conditionalmixture(x, P = NULL, ..., given_indices = NULL, given_values = NULL)
Arguments
x
A mixture object.
P
Optional predicate function for MC fallback.
...
Additional arguments.
given_indices
Integer vector of observed variable indices.
given_values
Numeric vector of observed values.
Details
Falls back to MC realization if P is provided or if any component does not support given_indices/given_values.
Value
A mixture or empirical_dist object.
Examples
# Closed-form conditioning on MVN mixture m <- mixture( list(mvn(c(0, 0), diag(2)), mvn(c(3, 3), diag(2))), c(0.5, 0.5) ) # Condition on X2 = 1 mc <- conditional(m, given_indices = 2, given_values = 1) mean(mc)
conditional.mvn
Conditional distribution for multivariate normal.
CRAN · 1.0.0 · algebraic.dist/man/conditional.mvn.Rd · 2026-05-07

Supports two calling patterns: Closed-form (via given_indices and given_values): Uses the exact Schur complement formula. Returns a normal (1D result) or mvn. Predicate-based (via P): Falls back to MC realization via ensure_realized.

Aliases
conditional.mvn
Usage
conditionalmvn(x, P = NULL, ..., given_indices = NULL, given_values = NULL)
Arguments
x
An mvn object.
P
Optional predicate function for MC fallback.
...
Additional arguments forwarded to the predicate P.
given_indices
Integer vector of observed variable indices.
given_values
Numeric vector of observed values (same length as given_indices).
Value
A normal, mvn, or empirical_dist object.
Examples
# Closed-form conditioning: X2 | X1 = 1 sigma <- matrix(c(1, 0.5, 0.5, 1), 2, 2) X <- mvn(c(0, 0), sigma) X2_given <- conditional(X, given_indices = 1, given_values = 1) mean(X2_given) vcov(X2_given) # Predicate-based MC fallback (slower) set.seed(42) X2_mc <- conditional(X, P = function(x) x[1] > 0)
countable_set
Countable Set
CRAN · 1.0.0 · algebraic.dist/man/countable_set.Rd · 2026-05-07

A countably infinite support set, such as the non-negative integers. It satisfies the concept of a support (see has, infimum, supremum, [base]dim).

Aliases
countable_set
Custom sections
Public fields
html<div class="r6-fields"> lower_boundInteger lower bound of the set. html</div>
Methods
Public methods #method-countable_set-newcountable_set$new() #method-countable_set-clonecountable_set$clone() html<hr> html<a id="method-countable_set-new"></a> latexmethod-countable_set-new Method new() Initialize a countable set. Usage html<div class="r">countable_set$new(lower = 0L)html</div> Arguments html<div class="arguments"> lowerInteger lower bound (default 0). html</div> html<hr> html<a id="method-countable_set-clone"></a> latexmethod-countable_set-clone Method clone() The objects of this class are cloneable with this method. Usage html<div class="r">countable_set$clone(deep = FALSE)html</div> Arguments html<div class="arguments"> deepWhether to make a deep clone. html</div>
delta_clt
Delta Method CLT Limiting Distribution
CRAN · 1.0.0 · algebraic.dist/man/delta_clt.Rd · 2026-05-07

Returns the limiting distribution of n(g(X_n) - g()) under the Delta Method. For a univariate distribution, this is N(0, g'()^2 ^2). For a multivariate distribution with Jacobian J = Dg(), this is MVN(0, J J^T).

Aliases
delta_clt
Usage
delta_clt(base_dist, g, dg)
Arguments
base_dist
A dist object representing the base distribution.
g
The function to apply to the sample mean.
dg
The derivative (univariate) or Jacobian function (multivariate) of g. For univariate distributions, dg(x) should return a scalar. For multivariate distributions, dg(x) should return a matrix (the Jacobian).
Value
A normal or mvn distribution representing the Delta Method limiting distribution.
Examples
# Delta method: g = exp, dg = exp x <- exponential(rate = 1) z <- delta_clt(x, g = exp, dg = exp) mean(z) vcov(z)
density.beta_dist
Probability density function for a beta distribution.
CRAN · 1.0.0 · algebraic.dist/man/density.beta_dist.Rd · 2026-05-07

Returns a function that evaluates the beta PDF at given points.

Aliases
density.beta_dist
Usage
densitybeta_dist(x, ...)
Arguments
x
A beta_dist object.
...
Additional arguments (not used).
Value
A function function(t, log = FALSE, ...) returning the density (or log-density) at t.
Examples
x <- beta_dist(2, 5) f <- density(x) f(0.3) f(0.5)
density.chi_squared
Method for obtaining the density (pdf) of a chi_squared object.
CRAN · 1.0.0 · algebraic.dist/man/density.chi_squared.Rd · 2026-05-07

Method for obtaining the density (pdf) of a chi_squared object.

Aliases
density.chi_squared
Usage
densitychi_squared(x, ...)
Arguments
x
The chi_squared object
...
Additional arguments (not used)
Value
A function that computes the pdf at point(s) t
Examples
x <- chi_squared(5) f <- density(x) f(5) f(10)
density.edist
Density for expression distributions.
CRAN · 1.0.0 · algebraic.dist/man/density.edist.Rd · 2026-05-07

Falls back to realize and delegates to density.empirical_dist.

Aliases
density.edist
Usage
densityedist(x, ...)
Arguments
x
An edist object.
...
Additional arguments forwarded to density.empirical_dist.
Value
A function computing the empirical density (PMF).
Examples
set.seed(1) z <- normal(0, 1) * exponential(1) fz <- density(z)
density.empirical_dist
Method for obtaining the pdf of a empirical_dist object.
CRAN · 1.0.0 · algebraic.dist/man/density.empirical_dist.Rd · 2026-05-07

Method for obtaining the pdf of a empirical_dist object.

Aliases
density.empirical_dist
Usage
densityempirical_dist(x, ...)
Arguments
x
The object to obtain the pdf of.
...
Additional arguments to pass into the pdf function.
Value
A function computing the empirical PMF at given points.
Examples
ed <- empirical_dist(c(1, 2, 2, 3, 3, 3)) f <- density(ed) f(2) # 2/6 f(3, log = TRUE) # log(3/6)
Note
sort tibble lexicographically and do a binary search to find upper and lower bound in log(nobs(x)) time.
density.exponential
Method to obtain the pdf of an exponential object.
CRAN · 1.0.0 · algebraic.dist/man/density.exponential.Rd · 2026-05-07

Method to obtain the pdf of an exponential object.

Aliases
density.exponential
Usage
densityexponential(x, ...)
Arguments
x
The object to obtain the pdf of
...
Additional arguments (not used)
Value
A function function(t, log = FALSE, ...) that computes the pdf (or log-pdf) of the exponential distribution at t.
Examples
x <- exponential(rate = 2) f <- density(x) f(0) f(1)
density.gamma_dist
Method for obtaining the density (pdf) of a gamma_dist object.
CRAN · 1.0.0 · algebraic.dist/man/density.gamma_dist.Rd · 2026-05-07

Method for obtaining the density (pdf) of a gamma_dist object.

Aliases
density.gamma_dist
Usage
densitygamma_dist(x, ...)
Arguments
x
The gamma_dist object
...
Additional arguments (not used)
Value
A function that computes the pdf at point(s) t
Examples
x <- gamma_dist(shape = 2, rate = 1) f <- density(x) f(1) f(2)
density.lognormal
Probability density function for a log-normal distribution.
CRAN · 1.0.0 · algebraic.dist/man/density.lognormal.Rd · 2026-05-07

Returns a function that evaluates the log-normal PDF at given points.

Aliases
density.lognormal
Usage
densitylognormal(x, ...)
Arguments
x
A lognormal object.
...
Additional arguments (not used).
Value
A function function(t, log = FALSE, ...) returning the density (or log-density) at t.
Examples
x <- lognormal(0, 1) f <- density(x) f(1) f(2)
density.mixture
Probability density function for a mixture distribution.
CRAN · 1.0.0 · algebraic.dist/man/density.mixture.Rd · 2026-05-07

Returns a function that evaluates the mixture density at given points. The mixture density is f(x) = _k w_k f_k(x).

Aliases
density.mixture
Usage
densitymixture(x, ...)
Arguments
x
A mixture object.
...
Additional arguments (not used).
Value
A function function(t, log = FALSE, ...) returning the density (or log-density) at t.
Examples
m <- mixture(list(normal(0, 1), normal(5, 1)), c(0.5, 0.5)) f <- density(m) f(0) f(2.5)
density.mvn
Function generator for obtaining the pdf of an mvn object (multivariate normal).
CRAN · 1.0.0 · algebraic.dist/man/density.mvn.Rd · 2026-05-07

Function generator for obtaining the pdf of an mvn object (multivariate normal).

Aliases
density.mvn
Usage
densitymvn(x, ...)
Arguments
x
The mvn (S3) object to obtain the pdf (density) of
...
Additional arguments passed to dmvnorm on every call.
Value
A function function(obs, log = FALSE, ...) that computes the pdf (or log-pdf) of the multivariate normal distribution.
Examples
X <- mvn(c(0, 0), diag(2)) f <- density(X) f(c(0, 0)) f(c(1, 1))
density.normal
Method for obtaining the pdf of an normal object.
CRAN · 1.0.0 · algebraic.dist/man/density.normal.Rd · 2026-05-07

Method for obtaining the pdf of an normal object.

Aliases
density.normal
Usage
densitynormal(x, ...)
Arguments
x
The object to obtain the pdf of
...
Additional arguments to pass (not used)
Value
A function function(t, log = FALSE, ...) that computes the pdf (or log-pdf) of the normal distribution at t.
Examples
x <- normal(0, 1) f <- density(x) f(0) f(1)
density.poisson_dist
Probability mass function for a Poisson distribution.
CRAN · 1.0.0 · algebraic.dist/man/density.poisson_dist.Rd · 2026-05-07

Returns a function that evaluates the Poisson PMF at given points.

Aliases
density.poisson_dist
Usage
densitypoisson_dist(x, ...)
Arguments
x
A poisson_dist object.
...
Additional arguments (not used).
Value
A function function(k, log = FALSE, ...) returning the probability mass (or log-probability) at k.
Examples
x <- poisson_dist(5) f <- density(x) f(5) f(0)
density.uniform_dist
Probability density function for a uniform distribution.
CRAN · 1.0.0 · algebraic.dist/man/density.uniform_dist.Rd · 2026-05-07

Returns a function that evaluates the uniform PDF at given points.

Aliases
density.uniform_dist
Usage
densityuniform_dist(x, ...)
Arguments
x
A uniform_dist object.
...
Additional arguments (not used).
Value
A function function(t, log = FALSE, ...) returning the density (or log-density) at t.
Examples
x <- uniform_dist(0, 10) f <- density(x) f(5) f(15)
density.weibull_dist
Probability density function for a Weibull distribution.
CRAN · 1.0.0 · algebraic.dist/man/density.weibull_dist.Rd · 2026-05-07

Returns a function that evaluates the Weibull PDF at given points.

Aliases
density.weibull_dist
Usage
densityweibull_dist(x, ...)
Arguments
x
A weibull_dist object.
...
Additional arguments (not used).
Value
A function function(t, log = FALSE, ...) returning the density (or log-density) at t.
Examples
x <- weibull_dist(shape = 2, scale = 3) f <- density(x) f(1) f(3)
dim.beta_dist
Dimension of a beta distribution (always 1).
CRAN · 1.0.0 · algebraic.dist/man/dim.beta_dist.Rd · 2026-05-07

Dimension of a beta distribution (always 1).

Aliases
dim.beta_dist
Usage
dimbeta_dist(x)
Arguments
x
A beta_dist object.
Value
1.
Examples
dim(beta_dist(2, 5))
dim.chi_squared
Retrieve the dimension of a chi_squared object.
CRAN · 1.0.0 · algebraic.dist/man/dim.chi_squared.Rd · 2026-05-07

Retrieve the dimension of a chi_squared object.

Aliases
dim.chi_squared
Usage
dimchi_squared(x)
Arguments
x
The chi_squared object
Value
1 (univariate)
Examples
dim(chi_squared(5))
dim.countable_set
Get the dimension of a countable set.
CRAN · 1.0.0 · algebraic.dist/man/dim.countable_set.Rd · 2026-05-07

Get the dimension of a countable set.

Aliases
dim.countable_set
Usage
dimcountable_set(x)
Arguments
x
A countable_set object.
Value
1 (always univariate).
Examples
cs <- countable_set$new(0L) dim(cs) # 1
dim.edist
Method for obtaining the dimension of an edist object.
CRAN · 1.0.0 · algebraic.dist/man/dim.edist.Rd · 2026-05-07

Determines the dimension by drawing a single sample and checking whether it is a matrix (multivariate) or scalar (univariate).

Aliases
dim.edist
Usage
dimedist(x)
Arguments
x
The edist object.
Value
Integer; the number of dimensions.
Examples
z <- normal(0, 1) * exponential(1) dim(z)
dim.empirical_dist
Method for obtaining the dimension of a empirical_dist object.
CRAN · 1.0.0 · algebraic.dist/man/dim.empirical_dist.Rd · 2026-05-07

Method for obtaining the dimension of a empirical_dist object.

Aliases
dim.empirical_dist
Usage
dimempirical_dist(x)
Arguments
x
The object to obtain the dimension of.
Value
Integer; the number of dimensions.
Examples
ed1 <- empirical_dist(c(1, 2, 3)) dim(ed1) # 1 ed2 <- empirical_dist(matrix(1:6, ncol = 2)) dim(ed2) # 2
dim.exponential
Method to obtain the dimension of an exponential object.
CRAN · 1.0.0 · algebraic.dist/man/dim.exponential.Rd · 2026-05-07

Method to obtain the dimension of an exponential object.

Aliases
dim.exponential
Usage
dimexponential(x)
Arguments
x
The exponential object to obtain the dimension of
Value
The dimension of the exponential object
Examples
dim(exponential(rate = 1))
dim.finite_set
Return the dimension of the finite set.
CRAN · 1.0.0 · algebraic.dist/man/dim.finite_set.Rd · 2026-05-07

Return the dimension of the finite set.

Aliases
dim.finite_set
Usage
dimfinite_set(x)
Arguments
x
A finite set.
Value
Integer; the dimension of the set.
Examples
fs <- finite_set$new(c(1, 3, 5, 7)) dim(fs) # 1
dim.gamma_dist
Retrieve the dimension of a gamma_dist object.
CRAN · 1.0.0 · algebraic.dist/man/dim.gamma_dist.Rd · 2026-05-07

Retrieve the dimension of a gamma_dist object.

Aliases
dim.gamma_dist
Usage
dimgamma_dist(x)
Arguments
x
The gamma_dist object
Value
1 (univariate)
Examples
dim(gamma_dist(2, 1))
dim.interval
Return the dimension of the interval.
CRAN · 1.0.0 · algebraic.dist/man/dim.interval.Rd · 2026-05-07

Return the dimension of the interval.

Aliases
dim.interval
Usage
diminterval(x)
Arguments
x
An interval object.
Value
Integer; the number of interval components.
Examples
iv <- interval$new(lower = 0, upper = 1) dim(iv) # 1
dim.lognormal
Dimension of a log-normal distribution (always 1).
CRAN · 1.0.0 · algebraic.dist/man/dim.lognormal.Rd · 2026-05-07

Dimension of a log-normal distribution (always 1).

Aliases
dim.lognormal
Usage
dimlognormal(x)
Arguments
x
A lognormal object.
Value
1.
Examples
dim(lognormal(0, 1))
dim.mixture
Dimension of a mixture distribution.
CRAN · 1.0.0 · algebraic.dist/man/dim.mixture.Rd · 2026-05-07

Returns the dimension of the first component (all components are assumed to have the same dimension).

Aliases
dim.mixture
Usage
dimmixture(x)
Arguments
x
A mixture object.
Value
The dimension of the distribution.
Examples
m <- mixture(list(normal(0, 1), normal(5, 1)), c(0.5, 0.5)) dim(m)
dim.mvn
Method for obtaining the dimension of an mvn object.
CRAN · 1.0.0 · algebraic.dist/man/dim.mvn.Rd · 2026-05-07

Method for obtaining the dimension of an mvn object.

Aliases
dim.mvn
Usage
dimmvn(x)
Arguments
x
The object to obtain the dimension of
Value
The dimension of the mvn object
Examples
dim(mvn(c(0, 0, 0)))
dim.normal
Method for obtaining the dimension of a normal object.
CRAN · 1.0.0 · algebraic.dist/man/dim.normal.Rd · 2026-05-07

Method for obtaining the dimension of a normal object.

Aliases
dim.normal
Usage
dimnormal(x)
Arguments
x
The normal object to obtain the dimension of
Value
The dimension of the normal object
Examples
dim(normal(0, 1))
dim.poisson_dist
Dimension of a Poisson distribution (always 1).
CRAN · 1.0.0 · algebraic.dist/man/dim.poisson_dist.Rd · 2026-05-07

Dimension of a Poisson distribution (always 1).

Aliases
dim.poisson_dist
Usage
dimpoisson_dist(x)
Arguments
x
A poisson_dist object.
Value
1.
Examples
dim(poisson_dist(5))
dim.uniform_dist
Dimension of a uniform distribution (always 1).
CRAN · 1.0.0 · algebraic.dist/man/dim.uniform_dist.Rd · 2026-05-07

Dimension of a uniform distribution (always 1).

Aliases
dim.uniform_dist
Usage
dimuniform_dist(x)
Arguments
x
A uniform_dist object.
Value
1.
Examples
dim(uniform_dist(0, 1))
dim.weibull_dist
Dimension of a Weibull distribution (always 1).
CRAN · 1.0.0 · algebraic.dist/man/dim.weibull_dist.Rd · 2026-05-07

Dimension of a Weibull distribution (always 1).

Aliases
dim.weibull_dist
Usage
dimweibull_dist(x)
Arguments
x
A weibull_dist object.
Value
1.
Examples
dim(weibull_dist(2, 3))
edist
Takes an expression e and a list vars and returns a lazy edist (expression distribution object), that is a subclass of d...
CRAN · 1.0.0 · algebraic.dist/man/edist.Rd · 2026-05-07

Takes an expression e and a list vars and returns a lazy edist (expression distribution object), that is a subclass of dist that can be used in place of a dist object.

Aliases
edist
Usage
edist(e, vars)
Arguments
e
the expression to evaluate against the arguments.
vars
the list of distributions (with variable names) to evaluate the expression e against.
Value
An edist object.
Examples
x <- normal(0, 1) y <- normal(2, 3) e <- edist(quote(x + y), list(x = x, y = y)) e
empirical_dist
Construct empirical distribution object.
CRAN · 1.0.0 · algebraic.dist/man/empirical_dist.Rd · 2026-05-07

Construct empirical distribution object.

Aliases
empirical_dist
Usage
empirical_dist(data)
Arguments
data
data to construct empirical distribution from. if matrix or data frame, each row is a joint observation, if a vector, each element is an observation. whatever data is, it must be convertible to a tibble.
Value
An empirical_dist object.
Examples
# Univariate empirical distribution from a vector ed <- empirical_dist(c(1, 2, 3, 4, 5)) mean(ed) # Multivariate empirical distribution from a matrix mat <- matrix(c(1, 2, 3, 4, 5, 6), ncol = 2) ed_mv <- empirical_dist(mat) dim(ed_mv)
ensure_realized
Memoized MC fallback materialization.
CRAN · 1.0.0 · algebraic.dist/man/ensure_realized.Rd · 2026-05-07

Single internal entry point for all Monte Carlo fallback paths. If x is already an empirical_dist, returns it unchanged. If x has a .cache environment (e.g. edist objects), caches the realization so that multiple method calls (e.g. cdf + density) share the same samples. Sample-size-aware: if the cached realization has fewer than n samples, re-realizes.

Aliases
ensure_realized
Keywords
internal
Usage
ensure_realized(x, n = 10000L)
Arguments
x
A distribution object.
n
Number of samples (default: 10000).
Value
An empirical_dist (or realized_dist).
expectation
Generic method for obtaining the expectation of f with respect to x.
CRAN · 1.0.0 · algebraic.dist/man/expectation.Rd · 2026-05-07

Generic method for obtaining the expectation of f with respect to x.

Aliases
expectation
Usage
expectation(x, g, ...)
Arguments
x
The distribution object.
g
The function to take the expectation of.
...
Additional arguments to pass into g.
Value
The expected value of g(x).
Examples
x <- exponential(1) # E[X] for Exp(1) is 1 expectation(x, function(t) t)
expectation.dist
Expectation of a Function Applied to a dist Object
CRAN · 1.0.0 · algebraic.dist/man/expectation.dist.Rd · 2026-05-07

Expectation operator applied to x of type dist with respect to a function g. Optionally, constructs a confidence interval for the expectation estimate using the Central Limit Theorem.

Aliases
expectation.dist
Usage
expectationdist(x, g = function(t) t, ..., control = list())
Arguments
x
A dist object.
g
Characteristic function of interest, defaults to identity.
...
Additional arguments to pass to g.
control
A list of control parameters: compute_stats - Logical, whether to compute CIs for the expectations, defaults to FALSE n - Integer, the number of samples to use for the MC estimate, defaults to 10000L alpha - Real, the significance level for the confidence interval, defaults to 0.05
Value
If compute_stats is FALSE, then the estimate of the expectation, otherwise a list with the following components: value - The estimate of the expectation ci - The confidence intervals for each component of the expectation n - The number of samples
Examples
# MC expectation of X^2 where X ~ Exp(1) set.seed(1) ex <- exponential(1) expectation(ex, g = function(t) t^2)
expectation.empirical_dist
Method for obtaining the expectation of empirical_dist object x under function g.
CRAN · 1.0.0 · algebraic.dist/man/expectation.empirical_dist.Rd · 2026-05-07

Method for obtaining the expectation of empirical_dist object x under function g.

Aliases
expectation.empirical_dist
Usage
expectationempirical_dist(x, g = function(t) t, ..., control = list())
Arguments
x
The distribution object.
g
The function to take the expectation of.
...
Additional arguments to pass into function g.
control
a list of control parameters: compute_stats - Whether to compute CIs for the expectations, defaults to FALSE n - The number of samples to use for the MC estimate, defaults to 10000 alpha - The significance level for the confidence interval, defaults to 0.05
Value
If compute_stats is FALSE, then the estimate of the expectation, otherwise a list with the following components: value - The estimate of the expectation ci - The confidence intervals for each component of the expectation n - The number of samples
Examples
ed <- empirical_dist(c(1, 2, 3, 4, 5)) expectation(ed) # E[X] = 3 expectation(ed, function(x) x^2) # E[X^2] = 11
expectation.poisson_dist
Exact expectation for a Poisson distribution.
CRAN · 1.0.0 · algebraic.dist/man/expectation.poisson_dist.Rd · 2026-05-07

Computes E[g(X)] using truncated summation over the support. The summation is truncated at the 1 - 10^-12 quantile to ensure negligible truncation error.

Aliases
expectation.poisson_dist
Usage
expectationpoisson_dist(x, g, ...)
Arguments
x
A poisson_dist object.
g
A function to take the expectation of.
...
Additional arguments passed to g.
Value
The expected value E[g(X)].
Examples
x <- poisson_dist(5) expectation(x, identity) expectation(x, function(k) k^2)
expectation.univariate_dist
Method for obtaining the expectation of f with respect to a univariate_dist object x.
CRAN · 1.0.0 · algebraic.dist/man/expectation.univariate_dist.Rd · 2026-05-07

Assumes the support is a contiguous interval that has operations for retrieving the lower and upper bounds.

Aliases
expectation.univariate_dist
Usage
expectationunivariate_dist(x, g, ..., control = list())
Arguments
x
The distribution object.
g
The function to take the expectation of.
...
Additional arguments to pass into g.
control
An (optional) list of control parameters for integrate or expectation_data (if x is not continuous)
Value
The expected value (numeric scalar), or the full integrate() result if compute_stats = TRUE.
Examples
x <- normal(3, 4) # E[X] for Normal(3, 4) is 3 expectation(x, function(t) t) # E[X^2] for Exp(1) is 2 expectation(exponential(1), function(t) t^2)
expectation_data
Function used for computing expectations given data (e.g., from an MC simulation or bootstrap). it expects a matrix, or ...
CRAN · 1.0.0 · algebraic.dist/man/expectation_data.Rd · 2026-05-07

example: expectation_data(D, function(x) (x-colMeans(D)) %*% t(x-colMeans(D))) computes the covariance of the data D, except the matrix structure is lost (it's just a vector, which can be coerced back to a matrix if needed).

Aliases
expectation_data
Usage
expectation_data( data, g = function(x) x, ..., compute_stats = TRUE, alpha = 0.05 )
Arguments
data
a matrix of data
g
a function to apply to each row of the data
...
additional arguments to pass to g
compute_stats
whether to compute CIs for the expectations
alpha
the confidence level for the confidence interval for each component of the expectation (if compute_stats is TRUE)
Value
if compute_stats is TRUE, then a list with the following components: value - The estimate of the expectation ci - The confidence intervals for each component of the expectation n - The number of samples otherwise, just the value of the expectation.
Examples
set.seed(42) data <- matrix(rnorm(200), ncol = 2) # sample mean with confidence interval expectation_data(data) # just the point estimate, no CI expectation_data(data, compute_stats = FALSE) # expectation of a function of the data (row-wise) expectation_data(data, g = function(x) sum(x^2))
exponential
Construct exponential distribution object.
CRAN · 1.0.0 · algebraic.dist/man/exponential.Rd · 2026-05-07

Construct exponential distribution object.

Aliases
exponential
Usage
exponential(rate)
Arguments
rate
failure rate
Value
An exponential distribution object.
Examples
x <- exponential(rate = 2) mean(x) vcov(x) format(x)
finite_set
Finite set
CRAN · 1.0.0 · algebraic.dist/man/finite_set.Rd · 2026-05-07

A finite set. It also satisfies the concept of a support.

Aliases
finite_set
Custom sections
Public fields
html<div class="r6-fields"> valuesA vector of values. html</div>
Methods
Public methods #method-finite_set-newfinite_set$new() #method-finite_set-hasfinite_set$has() #method-finite_set-infimumfinite_set$infimum() #method-finite_set-supremumfinite_set$supremum() #method-finite_set-dimfinite_set$dim() #method-finite_set-clonefinite_set$clone() html<hr> html<a id="method-finite_set-new"></a> latexmethod-finite_set-new Method new() Initialize a finite set. Usage html<div class="r">finite_set$new(values)html</div> Arguments html<div class="arguments"> valuesA vector of values. html</div> html<hr> html<a id="method-finite_set-has"></a> latexmethod-finite_set-has Method has() Determine if a value is contained in the finite set. Usage html<div class="r">finite_set$has(x)html</div> Arguments html<div class="arguments"> xA vector of values. html</div> html<hr> html<a id="method-finite_set-infimum"></a> latexmethod-finite_set-infimum Method infimum() Get the infimum of the finite set. Usage html<div class="r">finite_set$infimum()html</div> Returns A numeric vector of infimums. html<hr> html<a id="method-finite_set-supremum"></a> latexmethod-finite_set-supremum Method supremum() Get the supremum of the finite set. Usage html<div class="r">finite_set$supremum()html</div> Returns A numeric vector of supremums. html<hr> html<a id="method-finite_set-dim"></a> latexmethod-finite_set-dim Method dim() Get the dimension of the finite set. Usage html<div class="r">finite_set$dim()html</div> Returns The dimension of the finite set. html<hr> html<a id="method-finite_set-clone"></a> latexmethod-finite_set-clone Method clone() The objects of this class are cloneable with this method. Usage html<div class="r">finite_set$clone(deep = FALSE)html</div> Arguments html<div class="arguments"> deepWhether to make a deep clone. html</div>
format.beta_dist
Format a beta_dist object as a character string.
CRAN · 1.0.0 · algebraic.dist/man/format.beta_dist.Rd · 2026-05-07

Format a beta_dist object as a character string.

Aliases
format.beta_dist
Usage
formatbeta_dist(x, ...)
Arguments
x
A beta_dist object.
...
Additional arguments (not used).
Value
A character string describing the distribution.
Examples
format(beta_dist(2, 5))
format.chi_squared
Format a chi_squared object as a character string.
CRAN · 1.0.0 · algebraic.dist/man/format.chi_squared.Rd · 2026-05-07

Format a chi_squared object as a character string.

Aliases
format.chi_squared
Usage
formatchi_squared(x, ...)
Arguments
x
The chi_squared object
...
Additional arguments (not used)
Value
A character string describing the distribution
Examples
format(chi_squared(5))
format.edist
Format method for edist objects.
CRAN · 1.0.0 · algebraic.dist/man/format.edist.Rd · 2026-05-07

Format method for edist objects.

Aliases
format.edist
Usage
formatedist(x, ...)
Arguments
x
The object to format
...
Additional arguments (not used)
Value
A character string
Examples
z <- normal(0, 1) * exponential(2) format(z)
format.empirical_dist
Format method for empirical_dist objects.
CRAN · 1.0.0 · algebraic.dist/man/format.empirical_dist.Rd · 2026-05-07

Format method for empirical_dist objects.

Aliases
format.empirical_dist
Usage
formatempirical_dist(x, ...)
Arguments
x
The object to format
...
Additional arguments (not used)
Value
A character string
Examples
ed <- empirical_dist(c(1, 2, 3, 4, 5)) format(ed)
format.exponential
Format method for exponential objects.
CRAN · 1.0.0 · algebraic.dist/man/format.exponential.Rd · 2026-05-07

Format method for exponential objects.

Aliases
format.exponential
Usage
formatexponential(x, ...)
Arguments
x
The exponential object to format
...
Additional arguments (not used)
Value
A character string
Examples
format(exponential(rate = 2))

버전 이력

RepositoryVersionPublishedFirst seenLast seenDocs
CRAN1.0.02026-05-292026-05-30

보안

표시할 OSV 데이터가 없습니다.

문헌 신호

표시할 OpenAlex 데이터가 없습니다.