Hot answers tagged

13

The procedure below assumes that the original distribution $X$ (the "signal") is non-Gaussian, and $Y$ is Gaussian (normally distributed noise.) General procedure The procedure is as follows: Find a function $F$ that applied to a collection of real numbers produces one value (say, 0) for normally distributed data and other different values for ...


10

An alternative, and faster, way to generate samples with the desired distribution using TransformedDistribution: ClearAll[distF] distF[r_, σ_] := TransformedDistribution[{(r + d ) Sin[θ], (r + d ) Cos[θ]}, {Distributed[d, NormalDistribution[0, σ]], Distributed[θ, UniformDistribution[{0, 2 Pi}]]}] ListPlot[RandomVariate[distF[5, .5] , ...


7

Sorry for the trouble - I have found a way: data = Table[fTorusRand[5, 0.5], {i, 1, 100000}]; empD1 = SmoothKernelDistribution[data]; ContourPlot[PDF[empD1, {x, y}], {x, -8, 8}, {y, -8, 8}] Gives me what I want: Edit: So using the Jacobian here, I can get an exact PDF. Still messing around with the algebra though: $x = (r+d) \sin(\theta)$ and $y = ...


6

Below is an extended comment showing the effects that can happen when one ignores the correlations among parameter estimators (either on purpose or because journal authors or editors don't know enough about statistics to include necessary information). First I create some data with the same curve form as the function CDDHybrid and a set of predictor values ...


5

This is a naive approach, so I wonder if I am overlooking some complication here; I would have thought that, given the description of your distribution, you could consider the "solid of revolution" generated by rotating the PDF of a normal distribution with the required parameters around the vertical $z$ axis, so something like the following: ...


5

The package IndependentComponentAnalysis.m can be used for Independent Component Analysis (ICA). This answer uses the generated data from my previous answer (which is about opportunistic application of general Non-Negative Matrix Factorization for ICA). Load the package: ...


5

After looking at each of the 5 data sets, it does not appear at all that they might have residuals resulting from a single distribution (based on the estimates of mean square error). Why did you think they all had a common error distribution? Is there some theoretical or historical reason? As @AntonAntonov states, quantile regression can be more useful ...


4

response = {{"N","D","S","C","C"},{"N","D","S","C","C"}, {"Y","R","C","T","T"},{"N","D","S","C","C"}, {"Y","D","C","C","C"},{"Y","R","C","K","T"}, {"Y","R","C","T","T"},{"Y","D","S","C","C"}, {"Y","R","C","T","T"},{"Y","R","C","T","T"}, {"N","D","S","C","T"},{"Y","D","C","K","T"}}; In order for ...


4

Following up on @Karsten 7.'s approach, with a more convenient parameterization of PearsonDistribution (using pieces from PearsonDistribution >> Applications): ClearAll[pearsonD, dis, tdisn, tdisp] pearsonD[μ_, σ_, γ_, κ_] := PearsonDistribution[2 (9 + 6 γ^2 - 5 κ), -12 μ γ^2 - σ γ (3 + κ) + 2 μ (-9 + 5 κ), 6 + 3 γ^2 - 2 κ, -6 μ γ^2 + 4 μ ...


4

TL;DR: There is no PearsonDistribution that matches all characteristics exactly, but there is an infinite number of PearsonDistributions that resemble the given characteristics quite well. The difference between them is their standard deviation. In my personal opinion the information given in the question and its foundation are insufficient to make any ...


4

Could use Filling -> {4 -> {{1}, LightRed}, 1 -> {{3}, LightBlue}, 3 -> {{6}, LightRed}} and omit FillingStyle. Or Filling -> {1 -> {3}, 4 -> {6}}, FillingStyle -> {{LightBlue, Opacity[0.5]}, {LightRed, Opacity[0.5]}} which respectively produce the plots below.


3

The problem is that Expectation does not evaluate to a numeric result in all cases. It's also quite slow. You could replace it by NExpectation in the final integrand. I threw in an extra N for just to be sure. It takes so long to evaluate, I didn't have time to experiment. AverageProbSuccess[B_, \[Lambda]_] := Block[{n = 0, i, Expectation}, ...


3

It doesn't do anything, it just formats in a certain way. You can assign your own definition if you like. References: Operators without builtin meanings


3

Following @kglr the sum of squares $A^2+B^2+C^2+D^2$ divided by $\sigma^2$ has a noncentral chisquare distribution with 4 degrees of freedom and noncentrality parameter $\lambda=(\mu_A^2+\mu_B^2+\mu_C^2+\mu_D^2)/\sigma^2$. So the variance of the square root of the sum of squares can be obtained by finding the first and second raw moments: m1 = ...


3

Edit I did not know about RandomPoint! New in v10.2 So just use triangle = Triangle[{{0, 0}, {1, 1}, {2, 0}}]; randomtriangle = Triangle@RandomPoint[triangle, 3]; For the ListPlot: areas = Area /@ Triangle /@ RandomPoint[triangle, {n, 3}]; ListPlot[Area[triangle]/area] Unchanged: For stuff like this (sampling from a region) the RegionDistribution ...


3

It is certainly not required but usually one writes a weighted sum of probability density functions where the sum of the weights equals 1. In your example the sum of the weights is $\sqrt{\pi}$. One can rewrite the pdf of $X$ as $$f_X(x)={{2m^m x^{2m-1}}\over{\Gamma(m)}}\sum_{i=1}^n w_i h(t_i)$$ with $\sum_{i=1}^n w_i=1$. This makes it more explicit ...


3

@wolfies essentially gave you the answer in your original question where he wrote PDF[TransformedDistribution[x^2, x \[Distributed] RiceDistribution[v, Sqrt[α/2]]], y] Just change PDF to CDF (and avoid the use of I as @MarcoB recommended): CDF[TransformedDistribution[x^2, x \[Distributed] RiceDistribution[v, Sqrt[α/2]]], y]


3

Variant 1 define distribution_1 (losses) NSolve[Kurtosis[LogNormalDistribution[0, x]] == 12.2, x, Reals] {{x -> -0.579872}, {x -> 0.579872}} LogNormalDistribution[0, 0.5798723392706395`] // Kurtosis 12.2 LogNormalDistribution[0, 0.5798723392706395`] // Skewness 2.14932 dist1 = TruncatedDistribution[ {-\[Infinity], 0}, ...


2

A PDF is not a distribution. To convert a PDF to its associated distribution use ProbabilityDistribution Clear[λ, pb, Ps, μ] f[h_] := 1/Gamma[m]*(m/P)^m*h^(m - 1)*Exp[-(m*h)/P]; m = 1; P = 1; α = 4; δ = 2/α; int = Assuming[{A > 0, r > 0, λ > 0}, Integrate[(1 - Exp[-x*h*r^(-1/δ)])*pb*λ*π, {r, A, Infinity}, GenerateConditions -> False]] ...


2

This is an extended comment. f[h] as defined while clearly a probability density function is not of the type of function that Expectation expects. Consider the difference between the two functions f and g below: f[h_] := 1/Gamma[m]*(m/P)^m*h^(m - 1)*Exp[-(m*h)/P] (* Head *) Head[f] (* Symbol *) (* PDF *) f[h] (* (E^(-((h m)/P)) h^(-1 + m) ...


2

Update: Standard deviation of $(a^2 + b^2 + c^2 + d^2)^{1/2}$ With $ \lambda =( \mu _1^2+\mu _2^2+\mu _3^2+\mu _4^2 ) / \sigma^2$, td = TransformedDistribution[Sqrt@t, Distributed[t, NoncentralChiSquareDistribution[4,λ]]]; FullSimplify[StandardDeviation[td]] FullSimplify[Variance[td]] Original post: Standard deviation of $a^2 + b^2 + c^2 + ...


2

This may be an answer. Your code is ill-formed. It does not conform to Mathematica syntax. I have rewritten it to be valid and to better correspond to your pseudocode. There is no guarantee that it actually corresponds to the process you want to simulate, but at least it prints output and terminates. I hope it will help you to move forward. With[{n = 2}, ...


2

If you know the model form of the distribution you can use EstimatedDistribution[data, GammaDistribution[\[Alpha], \[Beta]]] or any other parametric distribution. These have a small memory footprint. For a non-parametric approach you can use the bin specifications of HistogramDistribution to reduce the memory footprint of the resulting DataDistribution. ...


2

Not really an answer ... more like an extended comment that is too long for the comment box. But I found the question interesting, for a number of reasons: I did not know that Mma had a FisherInformation function hidden away where you found it - how DID you find it? Your question actually highlights one of my pet dislikes - which is the naming of ...


1

$Version (* "10.4.1 for Mac OS X x86 (64-bit) (April 11, 2016)" *) dist[m_, s_] = ProbabilityDistribution[ 1/(E^((m - x)^2/(2*s^2))*(Sqrt[2*Pi]*s)), {x, -Infinity, Infinity}, Assumptions -> {s > 0, Element[m, Reals]}]; AppendTo[$ContextPath, "Statistics`Library`"]; (fi1 = FisherInformation[NormalDistribution[m, s]]) // MatrixForm ...


1

I'm going to argue that parameter information and paradise are not lost (until there's a specific counter-example). (* Define some function *) someFun[x_, μ_, σ_, a_, b_, c_] := (a/σ) Exp[-(x - μ)^b/(c σ^2)] (* Define a probability density function that depends on someFun and some yet to be given constants *) myDistribution[μ_, σ_] := ...


1

The brute force approach: p0 = RandomReal[ {-1, 1}, {3, 2}] {{-0.639468, -0.471533}, {-0.0621599, -0.952355}, {-0.253727, -0.133992}} triangle = Triangle[p0]; a0 = Area[triangle]; p = Select[RandomReal[ {-1, 1}, {30000, 2}], RegionMember[triangle, #] &]; Table[Area@Triangle[RandomSample[p, 3]]/a0, {1000}] // Mean 0.0826126 ...


1

I've installed the package, ?GrangerCausalityTest' gives GrangerCausalityTest[dat, lag] returns a p-value for the null hypothesis that the first element in dat does not cause the second element in dat. We remind the definition of the p-value (from Wikipedia): the p-value is widely used in statistical hypothesis testing, specifically in null ...



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