New answers tagged

1

This is an extended comment about your pdf not integrating to 1. I've typed in the code from the image you posted and I think it looks exactly like the image: dist = ProbabilityDistribution[(1 - Exp[λ*(1 - Exp[1])])^(-1) *λ*β*(γ/α)*(x/α)^(γ - 1)* (1 - Exp[-(x/α)^γ])^(β - 1)*Exp[λ*(1 - Exp[-(x/α)^γ])^β - (x/α)^γ + (1 - Exp[-(x/α)^γ])], {x, 1, ∞}, ...


8

If you draw the plot a bit less squeezed along the horizontal axis it looks like: The blue curve is from MMA and the orange one from you. Although your curves fits the first 2 points better it is far worse for the other points. In fact, the error square sum for the first and second curve are: {0.000157719, 0.000269005} You see, the squared error sum is ...


1

Consider one of the examples in the documentation for LinearModelFit: SeedRandom[12345]; data = Map[{#[[1]], #[[2]], #[[3]], 1.2 + (3.7 + RandomReal[{-1, 1}]) #[[1]] - 2 #[[2]] 23.4 #[[3]]} &, RandomReal[10, {100, 3}]]; lm = LinearModelFit[data, {x, y, z}, {x, y, z}]; (* Estimate of variance *) variance = lm["EstimatedVariance"] (* 12.6157 *...


2

You can use SmoothKernelDistribution with pts and extract the properties "InterpolationPoints" and "PDFValues" and combine them: skd = SmoothKernelDistribution[pts] xyz = Join[Tuples[skd["InterpolationPoints"]], List /@ skd["PDFValues"], 2]; Row[{Labeled[SmoothDensityHistogram[pts, PlotRange -> All, ImageSize ->...


6

cd = CategoricalDistribution[{{"Rain", "Fair"}, {"Win", "Lose"}}, {{0.4, 0.4}, {0.12, 0.08}}]; Update: Again using simple queries we can get two tables of conditional probabilities as Dataset objects probtable = Information[cd, "ProbabilityTable"]; condProbResultGivenWeather = probtable[All, Normalize[#, ...


7

I think your syntax is just fine. Probability just doesn't know how to do it. The brute force way, of course, is the following: cd = CategoricalDistribution[{{"Rain", "Fair"}, {"Win", "Lose"}}, {{0.4, 0.4}, {0.12, 0.08}}]; Probability[result == "Win" && weather == "Fair", {weather, result} \...


1

I believe the proposition that entropy cannot be negative applies only to categorical distributions, which are discrete distributions for which the categories have no intrinsic numerical values. For example, the outcome of a (stylized) coin flip can be characterized by two categories: Heads and Tails. One can associate the numbers 1 and 0 with those ...


3

I think you forgot some parentheses: NIntegrate[(1 - cdf[Sqrt[25]/Sqrt[15] 1.645 - Sqrt[10]/Sqrt[15] x])* pdf[x], {x, -Infinity, 1.645}] (* 0.0332387 *)


2

It seems that most of the probability mass of $p$ is between $15$ and $40$. Try: NIntegrate[-(p) Log[p], {x, 15, 40}] (*ans = 2.95531*) Your getting errors because Mathematica is blindly trying to numberically integrate extremely small real numbers outside this region. Check out the piecewise representation of $p$ You can see that the PDF is basically ...


2

By default the MovingAverage could be applied for 1-D lists but regarding to your case, you need make the TemporalData from your {t,y} list: y= Table[RandomReal[{-1, 1}] + 5 Sin[i/(6 Pi)], {i, 1, 100}]; t = Table[i + RandomReal[{-0.3, 0.3}], {i, 1, 100}]; (*As you see, the timestamps contain random shifts*) td = TemporalData[y, {t}]; ListPlot[{td, ...


1

@Chris gave you most if not all that you needed. Here is a follow-up to that answer: dist = TruncatedDistribution[{xmin, xmax}, LogNormalDistribution[μ, σ]] (* Mean *) mean = Simplify[Mean[dist], Assumptions -> {0 < xmin < xmax, σ > 0}] (* 15th percentile *) x15 = Simplify[InverseCDF[dist, 15/100], Assumptions -> {0 < xmin < xmax, σ &...


5

Note: While I was putting this answer together @Roman commented to perform a regression after taking the log of the response variable. I've implemented that suggestion below with a modification to take care of the unequal uncertainties across the values of the response variables. If the predictor variable has substantial uncertainty, then you should NOT ...


4

Try this: dataHist5 = {{Around[19.5, 1.5], Around[77.8, 8.8]}, {Around[37.5, 1.5], Around[63.5, 8.0]}, {Around[55.5, 1.5], Around[63.8, 8.0]}, {Around[109.5, 1.5], Around[42.4, 6.5]}, {Around[127.5, 1.5], Around[41.7, 6.5]}, {Around[145.5, 1.5], Around[14.6, 3.8]}}; dataHist5A = dataHist5 /. Around[x_, y_] -> x Then you fit the ...


2

"which one are correct for my purpose" Depends, what is your purpose? SeedRandom[1234]; dist1 = NormalDistribution[2, 2.5]; data must have more than one sample. Using sample size of 100 data1 = RandomVariate[dist1, 100]; dist2 = NormalDistribution[1, 0.5]; data2 = RandomVariate[dist2, 100]; {Style[#, 14, Bold], v = ToExpression[#]; Moment[v, 3]...


1

Well maybe one can find a general form for the cdf and pdf in terms of n given specified values of $a$, $b$, $c$, and $d$. Using your example the PDF's for n=2 to 6 are the following: bDist = TransformedDistribution[u + v, {u \[Distributed] GammaDistribution[a, b], v \[Distributed] GammaDistribution[c, d]}]; The pdf for a single observation from ...


1

An alternative way to use MomentConvert + MomentEvaluate: $\kappa _3$ Mean μκ3 = FullSimplify @ MomentConvert[Cumulant[3], {"SampleEstimator", n}, {"CentralMoment", n}]; TraditionalForm @ μκ3 MomentEvaluate[μκ3, NormalDistribution[]] 0 Variance σκ3 = FullSimplify[ MomentConvert[Cumulant[3]^2, {"SampleEstimator", n}, ...


2

mathStatica (for me) has the more straightforward way to getting what you asked (as @wolfies has demonstrated). Here is how to accomplish that in a somewhat similar fashion in Mathematica. (* Sample statistic *) (k4 = MomentConvert[Cumulant[4], "SampleEstimator"] /. PowerSymmetricPolynomial[0] -> n) // TraditionalForm (* Mean of sample ...


3

Here is a solution which is completely general, and works for any random variable whose moments exist. The standard Normal is then just a special and simple case. The OP is interested in the $3^\text{rd}$ and $4^\text{th}$ sample cumulants (a type of sample moment, similar to sample central moments). The lingua franca for working with sample moments, and ...


2

This is similar approach using FindSequenceFunction using the sample cumulant definition that Mathematica uses. (That sample cumulant definition is not always unbiased for the population cumulant.) First define a function that finds the variance for the k-th cumulant for a sample size of $n$ from a Normal[0,1] distribution. variance[k_, n_] := Module[{e1, ...


Top 50 recent answers are included