R 패키지 메타데이터와 수집 신호를 모아 봅니다.
첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.
DESCRIPTION에서 감지한 backend 관련 package입니다.
기본 메타데이터를 작은 카드와 토큰으로 압축합니다.
| Package | Type | Spec |
|---|---|---|
| mvtnorm CRAN · 1.0.0 · 2026-05-30 | Imports | mvtnorm |
| R6 CRAN · 1.0.0 · 2026-05-30 | Imports | R6 |
| stats CRAN · 1.0.0 · 2026-05-30 | Imports | stats |
| knitr CRAN · 1.0.0 · 2026-05-30 | Suggests | knitr |
| rmarkdown CRAN · 1.0.0 · 2026-05-30 | Suggests | rmarkdown |
| testthat CRAN · 1.0.0 · 2026-05-30 | Suggests | testthat (>= 3.0.0) |
| 검색 결과가 없습니다. | ||
| Package | Type | Spec |
|---|---|---|
| algebraic.mle 2.0.2 CRAN · 2026-05-30 | Imports | algebraic.dist (>= 0.9.1) |
| dist.structure 0.5.0 CRAN · 2026-05-30 | Imports | algebraic.dist |
| flexhaz 0.5.2 CRAN · 2026-05-30 | Imports | algebraic.dist |
| likelihood.model 1.0.1 CRAN · 2026-05-30 | Imports | algebraic.dist |
| maskedhaz 0.1.0 CRAN · 2026-05-30 | Imports | algebraic.dist |
| serieshaz 0.2.0 CRAN · 2026-05-30 | Imports | algebraic.dist |
| maskedcauses 0.9.3 CRAN · 2026-05-23 | Suggests | algebraic.dist |
| 검색 결과가 없습니다. | ||
| Type | Packages |
|---|---|
| Imports | 6 |
| Suggests | 1 |
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 operationsREADME 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 modelsHelp 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,Handles scalar * dist, dist * scalar, and dist * dist.
*dist(x, y)# 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) # TRUECreates an expression distribution and automatically simplifies to closed form when possible (e.g., normal + normal = normal, normal + scalar = normal with shifted mean).
+dist(x, y)# 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)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).
-dist(x, y)# 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)Handles dist / scalar (delegates to dist * (1/scalar)), scalar / dist, and dist / dist.
/dist(x, y)# Division by scalar reuses multiplication rule z <- normal(0, 4) / 2 z # Normal(mu = 0, var = 1)Handles exp(), log(), sqrt(), abs(), cos(), sin(), etc.
Mathdist(x, ...)# 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) # TRUEHandles sum(), prod(), min(), max() of distributions.
Summarydist(..., na.rm = FALSE)# 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)Power operator for distribution objects.
^dist(x, y)# Standard normal squared yields chi-squared(1) z <- normal(0, 1)^2 zComputes the distribution of AX + b where X MVN(, ). The result is MVN(A + b, A A^T).
affine_transform(x, A, b = NULL)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)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.
Generic method for converting objects (such as fitted models) into distribution objects from the algebraic.dist package.
as_dist(x, ...) as_distdist(x, ...)# Identity for existing distributions d <- normal(0, 1) identical(as_dist(d), d)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.
beta_dist(shape1, shape2)x <- beta_dist(shape1 = 2, shape2 = 5) mean(x) vcov(x) format(x)Generic method for obtaining the cdf of an object.
cdf(x, ...)x <- normal(0, 1) F <- cdf(x) F(0) # 0.5 (median of standard normal) F(1.96) # approximately 0.975Returns a function that evaluates the beta CDF at given points.
cdfbeta_dist(x, ...)x <- beta_dist(2, 5) F <- cdf(x) F(0.3) F(0.5)Method for obtaining the cdf of a chi_squared object.
cdfchi_squared(x, ...)x <- chi_squared(5) F <- cdf(x) F(5) F(10)Falls back to realize to materialize the distribution as an empirical_dist, then delegates to cdf.empirical_dist.
cdfedist(x, ...)set.seed(1) z <- normal(0, 1) * exponential(1) Fz <- cdf(z) Fz(0)If x is a multivariate empirical distribution, this function will throw an error. It's only defined for univariate empirical distributions.
cdfempirical_dist(x, ...)ed <- empirical_dist(c(1, 2, 3, 4, 5)) Fx <- cdf(ed) Fx(3) # 0.6 Fx(c(1, 5)) # 0.2, 1.0Method to obtain the cdf of an exponential object.
cdfexponential(x, ...)x <- exponential(rate = 1) F <- cdf(x) F(1) F(2)Method for obtaining the cdf of a gamma_dist object.
cdfgamma_dist(x, ...)x <- gamma_dist(shape = 2, rate = 1) F <- cdf(x) F(1) F(2)Returns a function that evaluates the log-normal CDF at given points.
cdflognormal(x, ...)x <- lognormal(0, 1) F <- cdf(x) F(1) F(2)Returns a function that evaluates the mixture CDF at given points. The mixture CDF is F(x) = _k w_k F_k(x).
cdfmixture(x, ...)m <- mixture(list(normal(0, 1), normal(5, 1)), c(0.5, 0.5)) F <- cdf(m) F(0) F(5)Method for obtaining the CDF of a mvn object.
cdfmvn(x, ...)X <- mvn(c(0, 0), diag(2)) F <- cdf(X) F(c(0, 0))Method for obtaining the cdf of an normal object.
cdfnormal(x, ...)x <- normal(0, 1) F <- cdf(x) F(0) F(1.96)Returns a function that evaluates the Poisson CDF at given points.
cdfpoisson_dist(x, ...)x <- poisson_dist(5) F <- cdf(x) F(5) F(10)Returns a function that evaluates the uniform CDF at given points.
cdfuniform_dist(x, ...)x <- uniform_dist(0, 10) F <- cdf(x) F(5) F(10)Returns a function that evaluates the Weibull CDF at given points.
cdfweibull_dist(x, ...)x <- weibull_dist(shape = 2, scale = 3) F <- cdf(x) F(1) F(3)Construct a chi-squared distribution object.
chi_squared(df)x <- chi_squared(df = 5) mean(x) vcov(x) format(x)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, ).
clt(base_dist)# CLT for Exp(2): sqrt(n)(Xbar - 1/2) -> N(0, 1/4) x <- exponential(rate = 2) z <- clt(x) mean(z) vcov(z)Generic method for obtaining the conditional distribution of a distribution object x given condition P.
conditional(x, P, ...)d <- empirical_dist(1:100) # condition on values greater than 50 d_gt50 <- conditional(d, function(x) x > 50) mean(d_gt50)Falls back to MC: materializes x via ensure_realized() and then conditions on the resulting empirical distribution.
conditionaldist(x, P, n = 10000L, ...)set.seed(1) x <- exponential(1) # Condition on X > 2 x_gt2 <- conditional(x, function(t) t > 2) mean(x_gt2)Falls back to realize and delegates to conditional.empirical_dist.
conditionaledist(x, P, ...)set.seed(1) z <- normal(0, 1) + exponential(1) z_pos <- conditional(z, function(t) t > 2) mean(z_pos)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:
conditionalempirical_dist(x, P, ...)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)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 = ...).
conditionalmixture(x, P = NULL, ..., given_indices = NULL, given_values = NULL)# 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)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.
conditionalmvn(x, P = NULL, ..., given_indices = NULL, given_values = NULL)# 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)A countably infinite support set, such as the non-negative integers. It satisfies the concept of a support (see has, infimum, supremum, [base]dim).
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).
delta_clt(base_dist, g, dg)# Delta method: g = exp, dg = exp x <- exponential(rate = 1) z <- delta_clt(x, g = exp, dg = exp) mean(z) vcov(z)Returns a function that evaluates the beta PDF at given points.
densitybeta_dist(x, ...)x <- beta_dist(2, 5) f <- density(x) f(0.3) f(0.5)Method for obtaining the density (pdf) of a chi_squared object.
densitychi_squared(x, ...)x <- chi_squared(5) f <- density(x) f(5) f(10)Falls back to realize and delegates to density.empirical_dist.
densityedist(x, ...)set.seed(1) z <- normal(0, 1) * exponential(1) fz <- density(z)Method for obtaining the pdf of a empirical_dist object.
densityempirical_dist(x, ...)ed <- empirical_dist(c(1, 2, 2, 3, 3, 3)) f <- density(ed) f(2) # 2/6 f(3, log = TRUE) # log(3/6)Method to obtain the pdf of an exponential object.
densityexponential(x, ...)x <- exponential(rate = 2) f <- density(x) f(0) f(1)Method for obtaining the density (pdf) of a gamma_dist object.
densitygamma_dist(x, ...)x <- gamma_dist(shape = 2, rate = 1) f <- density(x) f(1) f(2)Returns a function that evaluates the log-normal PDF at given points.
densitylognormal(x, ...)x <- lognormal(0, 1) f <- density(x) f(1) f(2)Returns a function that evaluates the mixture density at given points. The mixture density is f(x) = _k w_k f_k(x).
densitymixture(x, ...)m <- mixture(list(normal(0, 1), normal(5, 1)), c(0.5, 0.5)) f <- density(m) f(0) f(2.5)Function generator for obtaining the pdf of an mvn object (multivariate normal).
densitymvn(x, ...)X <- mvn(c(0, 0), diag(2)) f <- density(X) f(c(0, 0)) f(c(1, 1))Method for obtaining the pdf of an normal object.
densitynormal(x, ...)x <- normal(0, 1) f <- density(x) f(0) f(1)Returns a function that evaluates the Poisson PMF at given points.
densitypoisson_dist(x, ...)x <- poisson_dist(5) f <- density(x) f(5) f(0)Returns a function that evaluates the uniform PDF at given points.
densityuniform_dist(x, ...)x <- uniform_dist(0, 10) f <- density(x) f(5) f(15)Returns a function that evaluates the Weibull PDF at given points.
densityweibull_dist(x, ...)x <- weibull_dist(shape = 2, scale = 3) f <- density(x) f(1) f(3)Dimension of a beta distribution (always 1).
dimbeta_dist(x)dim(beta_dist(2, 5))Retrieve the dimension of a chi_squared object.
dimchi_squared(x)dim(chi_squared(5))Get the dimension of a countable set.
dimcountable_set(x)cs <- countable_set$new(0L) dim(cs) # 1Determines the dimension by drawing a single sample and checking whether it is a matrix (multivariate) or scalar (univariate).
dimedist(x)z <- normal(0, 1) * exponential(1) dim(z)Method for obtaining the dimension of a empirical_dist object.
dimempirical_dist(x)ed1 <- empirical_dist(c(1, 2, 3)) dim(ed1) # 1 ed2 <- empirical_dist(matrix(1:6, ncol = 2)) dim(ed2) # 2Method to obtain the dimension of an exponential object.
dimexponential(x)dim(exponential(rate = 1))Return the dimension of the finite set.
dimfinite_set(x)fs <- finite_set$new(c(1, 3, 5, 7)) dim(fs) # 1Retrieve the dimension of a gamma_dist object.
dimgamma_dist(x)dim(gamma_dist(2, 1))Return the dimension of the interval.
diminterval(x)iv <- interval$new(lower = 0, upper = 1) dim(iv) # 1Dimension of a log-normal distribution (always 1).
dimlognormal(x)dim(lognormal(0, 1))Returns the dimension of the first component (all components are assumed to have the same dimension).
dimmixture(x)m <- mixture(list(normal(0, 1), normal(5, 1)), c(0.5, 0.5)) dim(m)Method for obtaining the dimension of an mvn object.
dimmvn(x)dim(mvn(c(0, 0, 0)))Method for obtaining the dimension of a normal object.
dimnormal(x)dim(normal(0, 1))Dimension of a Poisson distribution (always 1).
dimpoisson_dist(x)dim(poisson_dist(5))Dimension of a uniform distribution (always 1).
dimuniform_dist(x)dim(uniform_dist(0, 1))Dimension of a Weibull distribution (always 1).
dimweibull_dist(x)dim(weibull_dist(2, 3))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.
edist(e, vars)x <- normal(0, 1) y <- normal(2, 3) e <- edist(quote(x + y), list(x = x, y = y)) eConstruct empirical distribution object.
empirical_dist(data)# 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)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.
ensure_realized(x, n = 10000L)Generic method for obtaining the expectation of f with respect to x.
expectation(x, g, ...)x <- exponential(1) # E[X] for Exp(1) is 1 expectation(x, function(t) t)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.
expectationdist(x, g = function(t) t, ..., control = list())# MC expectation of X^2 where X ~ Exp(1) set.seed(1) ex <- exponential(1) expectation(ex, g = function(t) t^2)Method for obtaining the expectation of empirical_dist object x under function g.
expectationempirical_dist(x, g = function(t) t, ..., control = list())ed <- empirical_dist(c(1, 2, 3, 4, 5)) expectation(ed) # E[X] = 3 expectation(ed, function(x) x^2) # E[X^2] = 11Computes E[g(X)] using truncated summation over the support. The summation is truncated at the 1 - 10^-12 quantile to ensure negligible truncation error.
expectationpoisson_dist(x, g, ...)x <- poisson_dist(5) expectation(x, identity) expectation(x, function(k) k^2)Assumes the support is a contiguous interval that has operations for retrieving the lower and upper bounds.
expectationunivariate_dist(x, g, ..., control = list())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)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).
expectation_data( data, g = function(x) x, ..., compute_stats = TRUE, alpha = 0.05 )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))Construct exponential distribution object.
exponential(rate)x <- exponential(rate = 2) mean(x) vcov(x) format(x)A finite set. It also satisfies the concept of a support.
Format a beta_dist object as a character string.
formatbeta_dist(x, ...)format(beta_dist(2, 5))Format a chi_squared object as a character string.
formatchi_squared(x, ...)format(chi_squared(5))Format method for edist objects.
formatedist(x, ...)z <- normal(0, 1) * exponential(2) format(z)Format method for empirical_dist objects.
formatempirical_dist(x, ...)ed <- empirical_dist(c(1, 2, 3, 4, 5)) format(ed)Format method for exponential objects.
formatexponential(x, ...)format(exponential(rate = 2))| Repository | Version | Published | First seen | Last seen | Docs |
|---|---|---|---|---|---|
| CRAN | 1.0.0 | 2026-05-29 | 2026-05-30 |
표시할 OSV 데이터가 없습니다.
표시할 OpenAlex 데이터가 없습니다.