Quantities in Probability & Statistics

Study Star Properties

StarData provides access to properties of over 105 stars. Select a random sample of 3000 stars to study.

In[1]:=
Click for copyable input
stars = StarData[{"RandomEntities", 3000}];

There are numerous properties provided for each of the entities.

In[2]:=
Click for copyable input
sun = \!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{Typeset`query$$ = "Sun", Typeset`boxes$$ = TemplateBox[{"\"Sun\"", RowBox[{"Entity", "[", RowBox[{"\"Star\"", ",", "\"Sun\""}], "]"}], "\"Entity[\\\"Star\\\", \\\"Sun\\\"]\"", "\"star\""}, "Entity"], Typeset`allassumptions$$ = {{ "type" -> "Clash", "word" -> "Sun", "template" -> "Assuming \"${word}\" is ${desc1}. Use as \ ${desc2} instead", "count" -> "4", "Values" -> {{ "name" -> "Star", "desc" -> " referring to stars", "input" -> "*C.Sun-_*Star-"}, { "name" -> "CalendarEventName", "desc" -> "a weekday", "input" -> "*C.Sun-_*CalendarEventName-"}, { "name" -> "Word", "desc" -> "a word", "input" -> "*C.Sun-_*Word-"}, { "name" -> "Surname", "desc" -> "a surname", "input" -> "*C.Sun-_*Surname-"}}}}, Typeset`assumptions$$ = {}, Typeset`open$$ = {1, 2}, Typeset`querystate$$ = { "Online" -> True, "Allowed" -> True, "mparse.jsp" -> 1.321761`6.572697926887039, "Messages" -> {}}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 4, Automatic, Dynamic[Typeset`query$$], Dynamic[Typeset`boxes$$], Dynamic[Typeset`allassumptions$$], Dynamic[Typeset`assumptions$$], Dynamic[Typeset`open$$], Dynamic[Typeset`querystate$$]], StandardForm], ImageSizeCache->{114., {7., 15.}}, TrackedSymbols:>{ Typeset`query$$, Typeset`boxes$$, Typeset`allassumptions$$, Typeset`assumptions$$, Typeset`open$$, Typeset`querystate$$}], DynamicModuleValues:>{}, UndoTrackedVariables:>{Typeset`open$$}], BaseStyle->{"Deploy"}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\);
In[3]:=
Click for copyable input
StarData[sun, "Properties"] // Length
Out[3]=

Extract effective temperature for the random selection of stars and select those for which data is available.

In[4]:=
Click for copyable input
temps = Flatten[ DeleteMissing[StarData[#, "EffectiveTemperature"]] & /@ Partition[stars, 100]];

Compute some descriptive statistics of temperatures.

In[5]:=
Click for copyable input
stats = {Min, Max, Mean, Median, StandardDeviation}; TableForm[{Map[#[temps] &, stats]}, TableHeadings -> {None, stats}]
Out[5]//TableForm=

Plot the star temperature histogram.

In[6]:=
Click for copyable input
h = Histogram[temps, 25, PDF, AxesLabel -> Automatic]
Out[6]=

Estimate the temperature distribution by a nonparametric distribution.

In[7]:=
Click for copyable input
skd = SmoothKernelDistribution[temps, "Oversmooth"]
Out[7]=

Estimate the temperature distribution by a parametric distribution with long tail.

In[8]:=
Click for copyable input
edist = EstimatedDistribution[temps, StableDistribution[a, b, c, d]]
Out[8]=

Compare the probability density function estimates and relate to the temperature of the Sun.

show complete Wolfram Language input
In[9]:=
Click for copyable input
pdf = PDF[skd, Quantity[x, "Kelvins"]]; sunTemp = {Directive[Red, Dashed], InfiniteLine[{{#, 0}, {#, 1}} &[ QuantityMagnitude[sun["EffectiveTemperature"]]]]}; Show[h, Plot[{pdf, PDF[edist, Quantity[x, "Kelvins"]]}, {x, 0, QuantityMagnitude@Max[temps]}, PlotRange -> All, PlotLegends -> {"Smooth Kernel Distribution Estimate", "Stable Distribution Estimate"}], Epilog -> {sunTemp, Inset[Style["Sun", Red, 12], {6800, .00034}]}]
Out[9]=

Related Examples

de es fr ja ko pt-br ru zh