MATHEMATICA FEATURED EXAMPLE
Fit Nonparametric and Parametric Distributions to Weighted Data
Generate random reals from
to
and weight them according to the PDF of a NormalDistribution using WeightedData:
| In[3]:= |
Create a WeightedData object and compute its mean and variance:
| In[5]:= |
| Out[6]= |
Fit to a NormalDistribution using maximum likelihood estimation:
| In[7]:= |
| Out[8]= |
Use HistogramDistribution to create a weighted histogram:
| In[9]:= |
| Out[10]= |
| In[11]:= |
| Out[11]= | ![]() |


