Tag Info

New answers tagged

1

This deserves a little explanation since I found that the behavior is sometimes inconsistent. Take some very simple data and create a function bound that illustrates how we suspect the bounded method is working (by reflecting the data about the bound, computing the estimate with the given bandwidth, and then truncating at the bound). data = {1, 2, 3}; ...


0

This is not an answer -- I just can't refrain from commenting on your coding style. Your expression Table[Plot[f[d, x], {x, -85, 60}, PlotLabel -> f], {f, {CDF}}] is valid, but it amazes me. I would never have thought of it. Because I am extremely simple-minded, I would have written {Plot[CDF[d, x], {x, -85, 60}, PlotLabel -> CDF]}


4

Simulate data data = RandomVariate[PowerDistribution[1, 2.5], 10^3]; dist = SmoothKernelDistribution[data]; Plot[CDF[dist, x], {x, 0, 1}] Export Data Export["cdf.xls", Table[{x, CDF[dist, x]}, {x, 0, 1, .01}]];


2

As @Sjoerd C. de Vries states: one really wants to use the raw data. However, your data is binned with (I assume) the bin midpoints along with the associated relative frequency. And ideally you should account for the binning (although in this case it doesn't make much difference in the estimates and because as stated by others the fit is not hot anyway). ...


5

This is a perfect place to use WeightedData. dist = EstimatedDistribution[WeightedData @@ Transpose[data], WeibullDistribution[a, b]] Show[ListPlot[data], Plot[PDF[dist, x], {x, 0, 30}]] It is worth noting that observations with zero weights are ignored because they do not contribute to the likelihood.


6

Your problem is that you are not fitting raw data to a distribution, you are fitting the emperical PDF of that distribution (probably in terms of values, percentages pairs). That won't work as the functions you are using (I guess EstimatedDistributionor FindDistributionParameters) expect the raw measurement data, not frequencies. To deal with your specific ...


6

It is a matter of definition, of course. Mathematica defines DirichletDistribution[{a1, a2, a3, a4}] to be a 3D distribution, compatible with 3D Lebesgue measure. The definition you have in mind is DirichletDistribution2[avec_List] := Block[{x, n = Length[avec] - 1}, TransformedDistribution[Append[Array[x, n], 1 - Total[Array[x, n]]], ...


1

As was noted by Sjoerd C. de Vries in the comments, DirichletDistribution[{a, b, c, d}] is a three-dimensional distribution: DistributionDomain@DirichletDistribution[{a, b, c, d}] (* {Interval[{0, 1}], Interval[{0, 1}], Interval[{0, 1}]} *) and therefore asking for the fourth marginal isn't defined.


10

Good news! Version 10.2 of Mathematica has this built-in with the function RandomPoint[]. From the documentation: RandomPoint can generate random points for any RegionQ region that is also ConstantRegionQ. RandomPoint will generate points uniformly in the region reg. The first example given is a simple disk, but there are a whole host of ...


0

With the solution above suggested by David G. Stork, I made this complete (?) working solution. I'm now wondering if it could be improved in some way. Currently, it's a bit slow. SeedRandom[]; f := {RandomReal[{0, 10}, 2], RandomReal[{0.5, 3}]} l = {f}; While[Length@l < 10, While[k = f; Not[And @@ ((# + k)[[2]] < EuclideanDistance[#[[1]], ...


11

The trick is to place some random non-overlapping Disks in your square area, then use the DistanceTransform to find a point in your square area that is the farthest from its nearest disk. (Such a point will be equidistant from at least two disks--generally three or more disks.) Place a new disk centered at this point, with its radius equal to the distance ...


2

The vertical height is determined by the range of the data. The method you chose sets the maximum width to be proportional to the square root of the data sizes. Since the data sizes are identical, the maximum widths are identical. The shape shows how the data is distributed across the range of the data. Compare your results with different size data sets ...


4

Using some of the other parameters of FindPeaks used in answer by @ubpdqn data = {{6, 2.1}, {6.25, 1.82394}, {6.5, 2.056}, {6.75, 2.48818}, {7, 5.73034}, {7.25, 11.3611}, {7.5, 11.5297}, {7.625, 10.6597}, {7.75, 14.5473}, {7.875, 13.7337}, {8, 14.291}, {8.125, 15.4141}, {8.25, 13.2849}, {8.375, 16.785}, {8.5, 14.6091}, {8.625, 17.0505}, ...


6

I am not sure FindDistributions is the approach you want. If I understand you wish to fit Gaussians (i.e. the probability density functions) to your data to estimate the peaks rather than estimate the Gaussian distribution parameters for a dataset you have some prior belief is normal. If the former is your aim there are obviously a variety of symmetric peak ...


13

Starting with a corrected version of your ProbabilityDistribution f[a_, b_, g_, c_, k_] := ProbabilityDistribution[ a b c k x^(c - 1) (1 + x^c)^(k - 1) ((1 + x^c)^k - 1)^(-b - 1) (1 + g ((1 + x^c)^k - 1)^-b)^(-(a/g) - 1), {x, 0, Infinity}, Assumptions -> a > 0 && b > 0 && g > 0 && c > 0 && k > ...



Top 50 recent answers are included