Tag Info

Hot answers tagged

12

The executive summary You can use the built-in Ellipsoid function directly with your calculated mean and covariance. For 95% confidence, use: Ellipsoid[mean, 6 cov] That expression returns an Ellipsoid object that you can visualize as an Epilog to a ListPlot, or as an argument to Graphics (further formatting below). Ellipsoids for other common critical ...


11

I will give you two similar methods. Simple Gaussian Threshold The simplest way is to remove the moving mean of the data, then compute its standard deviation ($\sigma$), then pick a level at which you want to reject the data, say at 1%, so you can remove any points that vary more than $ 3\times \sigma$ . If you know how the data is distributed about its ...


7

Update: An alternative approach is to extract coordinates of the Rectangles and use Show similar to the approach @Algohi's answer. We define an auxiliary function lF to generate the coordinates for the line we need, and use it in the function showF that takes an Histogram as input and Shows it together with a line joining the midpoints of the rectangle ...


6

The moving median is hardly affected at all by a few outliers, this can be used to identify the outliers. newData = Select[Transpose[{ data2[[10 ;;]], MovingMedian[data2, 10] }], Abs[Subtract @@ #] < 1 &] // Transpose; ListPlot[newData, PlotRange -> Full] In this piece of code 10 and 1 are arbitrarily chosen numbers that you ...


6

SeedRandom[123] n = 15; a = 0; b = 2; data = Sort[Sin[RandomVariate[UniformDistribution[{a, b}], n]]]; Yo can also specify the PlotStyle setting to add Point primitives to Lines: Plot[CDF[EmpiricalDistribution[data], y], {y, 0, 1}, Filling -> None, PlotStyle -> ({Orange, Thick, #, PointSize[.0125], Point[#[[1]]] & @@ #} &), ImageSize ...


5

Perhaps you could add point to each line segment after the plot is generated: SeedRandom[4]; data = Sort[Sin[2*RandomVariate[UniformDistribution[{0, 1}], 12] + 0]]; ScriptCapitalD = EmpiricalDistribution[data]; Plot[CDF[ScriptCapitalD, x], {x, 0, 1}, PlotStyle -> Orange, ExclusionsStyle -> None, Frame -> True] /. Line[p_] :> ...


5

Your histogram doesn't have regular binning, so you will want to specify how you want the binning done in your question. To get you started, however, here is an idea with regular binning. Otherwise you could adapt the code from your previous question on uneven binning to this problem. SeedRandom[10] sample = RandomVariate[NormalDistribution[], 200]; ...


4

This is a problem known as finding moments of moments. In this case, we seek the covariance (i.e. the $\mu_{1,1}$ central moment) of various sample moments. The modus operandi for solving such problems is to work with power sum notation $s_r$, namely: $$s_r = \sum_{i=1}^n X_i^r$$ In this case, you are interested in the sample mean $ = \frac{s_1}{n}$, and ...


4

Here is another way: histogram := Histogram[ RandomVariate[NormalDistribution[0, 1], 200], Automatic, Function[{bins, counts}, Sow[bins, "bins"]; Sow[counts, "counts"]] ] {g, bins} = Reap[histogram]; Show[ g, Graphics@Line@MapThread[{Mean[#], #2} &, Flatten[bins, 1]] ]


3

sample = RandomVariate[NormalDistribution[], 200]; histogramdata = Histogram[sample, {Sort@RandomReal[{-4, 4}, 20]}, "PDF"]; h = Cases[histogramdata, StatusArea[_, x_] :> x, -1]; w = Cases[histogramdata, RectangleBox[{x_, _}, {y_, _} | NCache[{y_, _}, _], __] :> Mean@{x, y}, -1]; Show[histogramdata, ListLinePlot[Transpose[{w, h}]]]


1

You can also use the options GridLines and Method -> {"GridLinesInFront" -> True}: SeedRandom[1]; grades = RandomInteger[{30, RandomInteger[{50, 100}]}, {7, 10}]; gridline = Median[Join @@ grades]; classes = {"Mathematics", "History", "English", "Chemistry", "Law", "Physics", "Statistics"}; BoxWhiskerChart[grades, "Outliers", ChartLabels -> ...


1

After looking about online a bit more I found the Epilog option. To draw my lines I have added Epilog->{Directive[{Thick, Red, Dashed}], Line[{{61,0},{61,10}}]} to the end of the BoxWhiskerChart environment. NB. The 10 in {60,10} is the height of the plot with respect to the bars. There are 9 bars plus half either side of the top two, hence 10.


1

Here's how to interpret statistical significance, here illustrated for a $\chi^2$ distribution: Such a distribution tells you the expected probability of finding a value of $x$ as the sum of squares of values chosen from $n$ univariate Gaussian distributions (where we call $n$ the degrees of freedom). Of course, the value of $x$ can never be negative. The ...



Only top voted, non community-wiki answers of a minimum length are eligible