WeightedData
✖
WeightedData
Details

- WeightedData augments data with weights for each data point.
- The data {x1,x2,…} and weights {w1,w2,…} should be lists of equal length.
- The weight function fn is applied to the list {x1,x2,…} and should return an explicit list of weights {w1,w2,…}.
- WeightedData can be used in statistics functions including:
-
Mean,Variance,… descriptive statistics functions EmpiricalDistribution,… nonparametric distribution estimation EstimatedDistribution,… parametric distribution estimation - WeightedData[{x1,x2,…}] gives data with equal weights.
- Properties of WeightedData can be obtained by specifying WeightedData[…]["property"].
- A list of available properties can be obtained using WeightedData[…]["Properties"].
- WeightedData has the following properties:
-
"EmpiricalPDF" data values and estimated weights "InputData" unweighted input data values "MetaInformation" a list containing meta-information rules "Weights" a list containing the data weights
Examples
open allclose allBasic Examples (1)Summary of the most common use cases

https://wolfram.com/xid/0h2rom4k7m-f1vfw

https://wolfram.com/xid/0h2rom4k7m-i9ljxw

Compute a weighted Mean and StandardDeviation:

https://wolfram.com/xid/0h2rom4k7m-qyv0h


https://wolfram.com/xid/0h2rom4k7m-bpk5jo

Scope (10)Survey of the scope of standard use cases
Create weighted univariate data:

https://wolfram.com/xid/0h2rom4k7m-df2a5v

https://wolfram.com/xid/0h2rom4k7m-co21so
Some weighted descriptive statistics:

https://wolfram.com/xid/0h2rom4k7m-ckyp8g

Add weights to a set of multivariate values:

https://wolfram.com/xid/0h2rom4k7m-gc3b4e

https://wolfram.com/xid/0h2rom4k7m-cknl3y

A set of weighted multivariate descriptive statistics:

https://wolfram.com/xid/0h2rom4k7m-e9d6ls


https://wolfram.com/xid/0h2rom4k7m-i0doty


https://wolfram.com/xid/0h2rom4k7m-eect9s

Use a pure function to create weighted data values:

https://wolfram.com/xid/0h2rom4k7m-e8pspd

https://wolfram.com/xid/0h2rom4k7m-hk9hx2

https://wolfram.com/xid/0h2rom4k7m-c6zxo0


https://wolfram.com/xid/0h2rom4k7m-b4zlp1

Visualize the impact of the various weighting schemes:

https://wolfram.com/xid/0h2rom4k7m-4zm2o

Fit nonparametric distributions to weighted data:

https://wolfram.com/xid/0h2rom4k7m-f7es

https://wolfram.com/xid/0h2rom4k7m-iwsv9


https://wolfram.com/xid/0h2rom4k7m-ihmsy

https://wolfram.com/xid/0h2rom4k7m-fzof5e

Fit parametric distributions to weighted data:

https://wolfram.com/xid/0h2rom4k7m-epb0fr

https://wolfram.com/xid/0h2rom4k7m-nnu1d


https://wolfram.com/xid/0h2rom4k7m-jumbt

Compare the estimated and empirical distributions:

https://wolfram.com/xid/0h2rom4k7m-2wxss

https://wolfram.com/xid/0h2rom4k7m-ge33gc

Extract the input data from a WeightedData object:

https://wolfram.com/xid/0h2rom4k7m-blw7tf

https://wolfram.com/xid/0h2rom4k7m-bq197b
Compare the distributions of the unweighted and weighted data:

https://wolfram.com/xid/0h2rom4k7m-03yqi

https://wolfram.com/xid/0h2rom4k7m-fjjo65

https://wolfram.com/xid/0h2rom4k7m-lsgjf

Obtain the weights from a WeightedData object:

https://wolfram.com/xid/0h2rom4k7m-eazgvh

https://wolfram.com/xid/0h2rom4k7m-i0ejbf
Visually inspect the effect of the weights on the data values:

https://wolfram.com/xid/0h2rom4k7m-zlfu3

Compute a weighted mean from the empirical PDF:

https://wolfram.com/xid/0h2rom4k7m-hqafaf

https://wolfram.com/xid/0h2rom4k7m-p2vfv8

https://wolfram.com/xid/0h2rom4k7m-ikmgyz

The weighted mean can be computed directly using Mean:

https://wolfram.com/xid/0h2rom4k7m-b5jug9

Find the weighted average of an irregularly sampled TimeSeries:

https://wolfram.com/xid/0h2rom4k7m-i8vsw


https://wolfram.com/xid/0h2rom4k7m-u3uc3

Compare with the average of values:

https://wolfram.com/xid/0h2rom4k7m-q2rkh


https://wolfram.com/xid/0h2rom4k7m-qx5fif

Create weighted data involving quantities:

https://wolfram.com/xid/0h2rom4k7m-dp8eet

https://wolfram.com/xid/0h2rom4k7m-eqpfu5
Some weighted descriptive statistics:

https://wolfram.com/xid/0h2rom4k7m-ql964x

Applications (2)Sample problems that can be solved with this function

https://wolfram.com/xid/0h2rom4k7m-hvndff

https://wolfram.com/xid/0h2rom4k7m-blozch

https://wolfram.com/xid/0h2rom4k7m-hnis3j

https://wolfram.com/xid/0h2rom4k7m-x67ciz

Estimate confidence interval for maximum likelihood estimates of distribution parameters:

https://wolfram.com/xid/0h2rom4k7m-fr0igp

https://wolfram.com/xid/0h2rom4k7m-c0fwx

Apply fractional random weight bootstrap to estimate confidence interval, by repeating weighted estimation with weights sampled from a DirichletDistribution with unit parameters:

https://wolfram.com/xid/0h2rom4k7m-dyp41z

https://wolfram.com/xid/0h2rom4k7m-lpayg0
Generate one thousand estimates of the distribution parameters:

https://wolfram.com/xid/0h2rom4k7m-kdcgm
Visualize bootstrap estimates:

https://wolfram.com/xid/0h2rom4k7m-fjc8se

Fit joint Gaussian distribution to the bootstrapped parameters:

https://wolfram.com/xid/0h2rom4k7m-7swc

Properties & Relations (2)Properties of the function, and connections to other functions
Descriptive statistics are based on the underlying EmpiricalDistribution:

https://wolfram.com/xid/0h2rom4k7m-dqtueh

https://wolfram.com/xid/0h2rom4k7m-flzoxq

https://wolfram.com/xid/0h2rom4k7m-fi9wvz

Sample estimates are given when they differ from population estimates:

https://wolfram.com/xid/0h2rom4k7m-zbp4w

WeightedData works for TimeSeries objects:

https://wolfram.com/xid/0h2rom4k7m-c80k57

For , the weights are proportional to
:

https://wolfram.com/xid/0h2rom4k7m-brb9vm


https://wolfram.com/xid/0h2rom4k7m-k632yu

Compare with bin‐sampled time average:

https://wolfram.com/xid/0h2rom4k7m-lujmoy


https://wolfram.com/xid/0h2rom4k7m-ewirn0


https://wolfram.com/xid/0h2rom4k7m-bz952v

https://wolfram.com/xid/0h2rom4k7m-cadij9


https://wolfram.com/xid/0h2rom4k7m-ea6e5

Wolfram Research (2012), WeightedData, Wolfram Language function, https://reference.wolfram.com/language/ref/WeightedData.html.
Text
Wolfram Research (2012), WeightedData, Wolfram Language function, https://reference.wolfram.com/language/ref/WeightedData.html.
Wolfram Research (2012), WeightedData, Wolfram Language function, https://reference.wolfram.com/language/ref/WeightedData.html.
CMS
Wolfram Language. 2012. "WeightedData." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WeightedData.html.
Wolfram Language. 2012. "WeightedData." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WeightedData.html.
APA
Wolfram Language. (2012). WeightedData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WeightedData.html
Wolfram Language. (2012). WeightedData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WeightedData.html
BibTeX
@misc{reference.wolfram_2025_weighteddata, author="Wolfram Research", title="{WeightedData}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/WeightedData.html}", note=[Accessed: 07-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_weighteddata, organization={Wolfram Research}, title={WeightedData}, year={2012}, url={https://reference.wolfram.com/language/ref/WeightedData.html}, note=[Accessed: 07-March-2025
]}