# Tag Info

## Hot answers tagged statistics

12

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 > ...

8

As I said in the comments, under the null hypothesis (in this case that the data was drawn from a particular distribution family) the p-value should follow a uniform distribution on (0,1). Let me illustrate with a simple z-test. ztest[data_, mu0_, sigma_] := Block[{z, p, d}, z = (Mean[data] - mu0)/(sigma/Sqrt[Length[data]]); d = NormalDistribution[]; ...

6

I think this is the most compact I can get without defining my own function: InverseCDF[NormalDistribution[mu, sigma], prob]

4

You specifically use the method of moments, is that meant to be a real problem constraint? If you can instead use the maximum likelihood estimate for {a,b} then you can you perform a straightforward likelihood ratio (LR) test. In the following quick check, the LR test statistic is approximately Chi-Square distributed (see Wilk's theorem), so you can accept ...

4

The second set is just the Round-ed version of the first set, which means there is a strong correlation between both sets (correlation close to 1). A naive and rough (and incorrect) approach would be to say that the variances of both sets will be very close as the differences caused by rounding are relatively small compared to the values involved. The ...

4

Here is a brute-force method (and I'm sure there are many more efficient approaches): data = RandomVariate[BinormalDistribution[.75], 100]; (* Calculate a nonparametric density estimate *) d = SmoothKernelDistribution[data]; (* Evaluate the estimated density function over a grid of points and sort by the density values from high to low *) pdf = Reverse[ ...

3

Here's a solution like Jim Baldwin's, but a little less brutal. I don't see a need for the mesh when you can get the density estimate for each data point: (* two dimensional data *) data = RandomVariate[BinormalDistribution[.5], 200]; (* nonparametric density estimate *) d = SmoothKernelDistribution[data]; (* logged density estimate at data *) p = PDF[d, ...

3

This is a fast discrete approach i = Import["http://i.stack.imgur.com/D2GVe.png"]; tid = Transpose[ ImageData[ColorSeparate@ColorConvert[i, "HSB"] // Last]]; nm = Max /@ tid; Histogram[2.2/4 MapThread[Count[Sign[#1 - #2/2], 1] &, {tid, nm}]] Addressing @BlacKow comments below, the following shows that the method works well for this data because all ...

2

Collecting timings for a range of starting values for the p parameter shows that the timing is critically dependent on this value. The peak happens to be close to the fitted value of p, 0.215. I assume that the gradient in the neigborhood is so low that the algorithm needs many iterations to converge. The multidimensionality of the situation won't help ...

1

Median itself doesn't work on associations of vectors: In[9]:= Median[{<|"a" -> 1, "b" -> 2|>, <|"a" -> 3, "b" -> 4|>}] During evaluation of In[9]:= Median::rectn: Rectangular array of real numbers is expected at position 1 in Median[{<|a->1,b->2|>,<|a->3,b->4|>}]. >> Out[9]= Median[{<|"a" -> 1, ...

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