# Tag Info

2

"PDF" gives you the average probability within a bin, that is, multiply the value by bin width to get a bin's total probability. "Probability" does this for you automatically.

0

$Version (* "12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)" *) Clear["Global*"] dist = ProbabilityDistribution[(E^((1 - E^Nu) n) Nu^x BellB[n, x])/x!, {x, 0, Infinity, 1}, Assumptions -> {Element[n, Integers], n >= 0}, Method -> "Normalize"]; Verifying that the distribution is valid for some typical ... 1 p = 1/3; SeedRandom[1] Pick[list, RandomVariate[BernoulliDistribution[p], Length[list]], 1] {a, b, g} SeedRandom[1] Extract[list, Position[1]@RandomVariate[BernoulliDistribution[p], Length[list]]] {a, b, g} SeedRandom[1] list[[Flatten@Position[1]@RandomVariate[BernoulliDistribution[p], Length[list]]]] {a, b, g} SeedRandom[1] list[[PositionIndex[... 0 Direct method to do what the OP was trying to do, but faster: NProbability[ Total[Array[x, 100]] <= 55, Array[x, 100] \[Distributed] ProductDistribution[{BernoulliDistribution[1/2], 100}] ] 0.864673 This is still not a very scaleable method, though. 4 I wonder if you went to the wrong solution because you used an inefficient approach to calculate the sum. Either of the following work almost instantaneously: AbsoluteTiming[Sum[PDF[BinomialDistribution[100, 1/2], x], {x, 0, 55}]] (* {0.0065887, 68482723177360620218041365161/79228162514264337593543950336} *) AbsoluteTiming[CDF[BinomialDistribution[100, 1/2]... 2 Given a discrete distribution$D\$ of finite variance, you only need the mean and standard deviation to apply the central limit theorem here: dist = BinomialDistribution[100,1/2] mu = Mean[dist]; sd = StandardDeviation[dist]; nclt = NormalDistribution[mu, sd]; It is important to apply a continuity correction, since we've gone from a discrete to continuous ...

5

There is no need (or reason) to create TestData. The parameter x0 can be directly estimated from ExperimentData. Also you likely have 2 parameters to estimate: x0 and the error variance (unless you're able to specify that as known which is rare). (* Generate data *) SeedRandom[12345]; ExperimentData = Table[{x, f[-1.123, x] + RandomVariate[...

1

The density you have is related to a half Normal distribution but that is not essential to know to obtain the maximum likelihood estimates and obtain an estimate of precision for that estimator. First create a distribution based on the density: dist = ProbabilityDistribution[(Sqrt[(2/π)]/σ) Exp[-(x - μ)^2/(2 σ^2)], {x, μ, ∞}, Assumptions -> σ > 0] ...

4

This is done with EstimatedDistribution and the ParameterEstimator -> "MaximumLikelihood" option: data = RandomVariate[NormalDistribution[], 100]; EstimatedDistribution[data, NormalDistribution[0, σ], ParameterEstimator -> "MaximumLikelihood" ] NormalDistribution[0, 0.918944] Use ProbabilityDistribution if you need to define a ...

0

It can be solved by increasing the precision with SetPrecision. See the excerpt below. This question has also been solved here: https://mathoverflow.net/questions/366754/inaccurate-results-for-the-analytical-expression-of-mathbbe-left-a-mathcal/366791#366798 prec = 100; m = 16; a = 4 (1 - (1/Sqrt[m])); b = 3/(m - 1); pdb = -12; p = 10^(pdb/10); betag = (1....

2

Is this what you want? data = {{0.002, 2.51053}, {0.004, 2.54217}, {0.006, 2.55543}, {0.008, 2.54247}}; lm = NonlinearModelFit[data, a x + b, {a, b}, x] bands[x_] = lm["MeanPredictionBands", ConfidenceLevel -> .95] Show[ListPlot[data], Plot[{lm[x], bands[x]}, {x, 0, 0.01}, Filling -> {2 -> {1}}], Frame -> True, Axes -> False, ...

2

For simple applications of regression, there is no need to fit multiple dependent variables simultaneously. The results are the same as a regression of each dependent variable separately. There are caveats if you are doing further analysis, but if you just want the basic regression results, you can do separate fits.

8

You can build the regression yourself as an NMinimize of residuals which are squared distances to points. First let's build some synthetic noisy data: (* create some noisy data that follows a linear model *) n = 1000; datax = RandomReal[{-1, 1}, {n, 2}]; testmtx = {{3, 4}, {1/2, 1/6}}; testoffset = {3/2, 5/7}; fn[{x1_, x2_}] := testmtx.{x1, x2} + testoffset ...

11

LinearModelFit doesn't do multivariate regression as far as I'm aware. You can use my repository function BayesianLinearRegression instead. The first example in the "Scope" section shows you how. You can provide the data in the format data[[All, {1, 2}]] -> data[[All, {3, 4}]] or #[[{1, 2}]] -> #[[{3, 4}]]& /@ data For example: fitData =...

4

Form the TransformedDistribution in steps. Clear["Global*"] dist1 = TransformedDistribution[Sqrt[-2 Log[U1]], U1 \[Distributed] UniformDistribution[]]; dist2 = TransformedDistribution[Cos[2 π U2], U2 \[Distributed] UniformDistribution[]]; dist = TransformedDistribution[x*y, {x \[Distributed] dist1, y \[Distributed] dist2}]; EDIT: ...

1

I've often thought it was more fun (and more pedagogical) to pose the Monte Carlo version of this problem in a pessimistic way: How often would this observation occur for some hypothetical "true" result? This is pessimistic, in the sense that it focuses on the probability of being wrong. The first step is to simulate the possible observed maxima ...

1

You want to sample "without replacement" so it is RandomSample rather than RandomChoice. Matching the usual notation is awkward with Mathematica because N is reserved so I'm taking the liberty to modify all of the notation. Here is an example of how well the usual Frequentist estimator works for 60 tanks and a sample size of 4. (* True number of ...

5

It's not too hard to set this up. I had no luck with the more complex four parameter GammaDistribution but fortunately you only mentioned the two parameter version: q[x_] = 1/(2 π) Integrate[Exp[-u^2/2], {u, x, ∞}] G = GammaDistribution[κ, θ]; gpdf = PDF[G, y] result = a*Expectation[q[Sqrt[b] y], y \[Distributed] G] Result: 2^(-3 - κ/2) a b^(-(1/2) - κ/ 2)...

5

The definition of the distribution is actually give in the documentation, and it should be rather straight forward to port it. The definition is $$f(x) = \frac{1}{n h}\sum^n_{i=1}k\left(\frac{x-x_i}{h}\right).$$ The only unknown here is h, the bandwidth, which can be extracted from the DataDistribution object. Sample distribution and data: dist = ...

1

You could use: trdist = TruncatedDistribution[{0, 0.04}, ExponentialDistribution[10]]; sample = RandomVariate[trdist, 256]; Histogram[sample, {Subdivide[-0.04, 0.08, 15]}]

0

Mathematica and Wolfram Language are knowledge-based. The structure is that Histogram in general is independent of the options and distributions. If a known distribution is entered in Histogram than some options make sense. So use an example from the documentation page of Histogram: Histogram[ RandomVariate[WeibullDistribution[2, 1], 1000], Automatic, &...

3

To obtain what Mathematica uses as a Chisquare test for testing if data comes from a Poisson distribution, then the following will work for your data? geigerData = {466, 471, 500, 442, 469, 448, 481, 470, 486, 472, 446, 487, 454, 485, 453, 447, 488, 454, 523, 478, 461, 473, 472, 466, 458, 463, 451, 455, 465, 488, 488, 413, 448, 453, 438, 453, 452, ...

1

You can use RandomVariate to generate samples for given distributions. sample = RandomVariate[ExponentialDistribution[1/10], 10000] ; Show[Histogram[sample,100,"ProbabilityDensity"],Plot[PDF[ExponentialDistribution[1/10],x],{x,0,50}]]

Top 50 recent answers are included