Hot answers tagged

15

ClearAll[hangingRootogram] hangingRootogram[dat_, estdist_, binspec_: Automatic][sc___ : .9, o: OptionsPattern[]] := With[{hd = HistogramDistribution[dat, binspec], bins = HistogramList[dat, binspec][[1]]}, With[{es = sc Min@Differences@bins}, DiscretePlot[{Sqrt@PDF[estdist, x] - Sqrt@PDF[hd, x], Sqrt@PDF[estdist, x]}, {x, bins}, ExtentSize -&...


8

The defined function RootHistogram makes a "hanging rootogram" more-or-less following this definition. The first argument is the data. The second argument dist is optional distribution. The function uses SmoothHistogram for the hanging curve and the third argument, bandWidth, is the band width argument of SmoothHistogram. The bspec argument is given to ...


6

I don't know how to interprete scaling of frequencies and associated expected curve so I will just plot PDF. This answer isn't complete then! Here is a simple way to hang those bars using ChartElementFunction: d = NormalDistribution[0, 1] n = 100 data = RandomVariate[d, n]; bspec = {-5, 5, .5}; f[{{xmin_, xmax_}, {ymin_, ymax_}}, ___] := Module[{ m ...


4

Using the code as in the OP, slightly modified: proc[μ_, σ_] := ItoProcess[ \[DifferentialD]x[t] == μ \[DifferentialD]t + σ \[DifferentialD]w[t], x[t], {x, 0}, t, w \[Distributed] WienerProcess[] ] paths = RandomFunction[proc[0.5, 1], {0, 10, 0.01}, 100]; Then, we define the function f[x_, t_] = E^(-((-x + x0 + t μ)^2/(2 t σ^2)))/(Sqrt[2 ...


2

Mathematica automatically set vertex shape to point when graph is large. You can reset vertex shape to "Circle": GraphDrawing = SetProperty[ TestGraph, {VertexSize -> VertexSizeRules, VertexShapeFunction -> "Circle", ImageSize -> 600}]


2

This is a much simpler approach than already given and simply takes theoretical and measured values: rootogram[theory_, observations_] := Show[{ ListLinePlot[{theory}, PlotMarkers -> {Automatic, 10}], Graphics[{Table[ Line[{{i, theory[[i]]}, {i, measurements[[i]] - theory[[i]]}}], {i, Length[theory]}]}] }] theory = {3, 5, 7, 9, ...


2

The problem is plot quality, not the code. The answer is MaxRecursion ParametricPlot3D[{I01[x, y], I11[x, y], I02[x, y]}, {x, 0, 8 \[Pi]}, {y, 0, 8 \[Pi]}, MaxRecursion -> 5]


2

Here is a solution via the Wolfram LibraryLink technique: First, let us make a comparison between BezierNonzeroBasis[n, u] and BernsteinBasis[n, Range[0, n], u] Do[BezierNonzeroBasis[10, 0.1], {10000}] // AbsoluteTiming Do[BernsteinBasis[10, Range[0, 10], 0.1], {10000}] // AbsoluteTiming BezierNonzeroBasis[10000, 0.1]; // AbsoluteTiming ...



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