Tag Info

New answers tagged

0

Problem is partially solved by using functions MixtureDistribution and twice TruncatedDistribution instead, this is actually how SplicedDistribution should be definen, the only non-important change in code is multiplication of tau by 1/sqrt(2). In[48] needs some time for symbolical computation, around 90sec on Core i7.


5

You can use DistributionDomain to find the domain of a distribution, which will also tell you the dimension. I do not know where this is documented, but it does appear in some examples in the documentation. Usage examples: DistributionDomain[NormalDistribution[]] (* Interval[{-∞, ∞}] *) DistributionDomain[ParetoDistribution[xmin, alpha]] (* ...


1

Per my comment (this is not a fleshed out answer, just an example ): entX[p_] := With[{vars = Unique[] & /@ Range@Length@p}, Expectation[-Log[PDF[p, vars]], vars \[Distributed] p]] entX[nd2] (* 1+Log[2 π] *) Note, you'll want to use more sophistacated means to detrmine needed number, Length works here for your example, and is probably OK for some ...


1

Few more alternatives/variations: data = RandomReal[50, 100]; (* HistogramList with height spec "SF" *) ListLinePlot[#, PlotRange -> {{0, 60}, Automatic}] &@ Thread@PadRight@HistogramList[data, 1000, "SF"] (* SurvivalFunction and EmpiricialDistribution *) Plot[SurvivalFunction[EmpiricalDistribution[data], x], {x, 0, 60}, Exclusions -> None] ...


2

You mean something like this? list = RandomVariate[BinomialDistribution[100, 0.1], {10000}]; You can use list to construct an EmpiricalDistribution, and then use DiscretePlot (if the list is all integers) or Plot (if it's reals) to plot the complement of its CDF. dist = EmpiricalDistribution[list]; DiscretePlot[1 - CDF[dist, x], {x, 0, 100}, PlotRange ...


2

E.g.: test = RandomInteger[100, 100]; ListLinePlot[With[{r = Reverse@Sort@Tally[test]}, Transpose[{Reverse@r[[All, 1]], Reverse@Accumulate@r[[All, 2]]}]]]


1

This might help you get going. Note - I shaped the code into a bit more Mathematica style, but in reality, there are more compact ways of doing this (e.g. directly invoking InverseCDF, etc.) but that will be a good learning experience. From your code, I'm guessing an imperative language background. In general, not good habits for Mathematica code: check the ...


5

There is actually a fair bit going on here that can make this confusing. The critical thing is the difference between testing fit to a family of distributions compared to testing fit to a particular distribution. Let me demonstrate. SeedRandom[23]; data = RandomVariate[NormalDistribution[1, 2], 100]; DistributionFitTest[data, NormalDistribution[mu, ...


4

If you wanted to automate things you might do something like this: tests = Sort[(g = DistributionFitTest[ w, #, {"PValue", "FittedDistribution"}]) & /@ { GammaDistribution[a, b, c, d], NormalDistribution[a, b], ChiSquareDistribution[a], HalfNormalDistribution[a], ...


12

The mathematica help is very thorough and is very indicative of what you should do next. By way of the histogram diagram obtained, you can compare your data against the proposed distribution. Show[Histogram[w[[2, 1]], Automatic, "ProbabilityDensity"], Plot[PDF[h["FittedDistribution"], x], {x, 0, 1500}, PlotStyle -> Thick]] The reference points you ...



Top 50 recent answers are included