Tag Info

New answers tagged

2

The two are not equivalent. The first is a one-sided distribution (a^2 is nonnegative) whereas the second is two-sided (a*b is both positive and negative). You can also generate the first from the HalfNormalDistribution: Assuming[x > 0, PDF[TransformedDistribution[ a^2, {a \[Distributed] NormalDistribution[0, 1]}], x] == ...


0

I wrote my thesis "Implementation of an algorithm for verifying the non-negativity of a multilinear function in a hypercube" about this here (password is "sal" and username "sal"). The key algorithm is not specified in the publication, focusing only on the key implementation idea with the hypercubes -- this was a requirement by my instructor. Shortly I ...


5

You could use ProbabilityDistribution. d = ProbabilityDistribution[ Piecewise[{{1, 0 < x < 1/2}, {1, 1 < x < 3/2}}, 0], {x, -\[Infinity], \[Infinity]}] Mean[d] (* 3/4 *) Or alternatively MixtureDistribution. d2 = MixtureDistribution[{1, 1}, {UniformDistribution[{0, 1/2}], UniformDistribution[{1, 3/2}]}] Mean[d2] (* 3/4 ...


3

Just use $E(X)=\int^{\infty}_{-\infty}x \, PDF(x)\, dx$ f[x_] := Piecewise[{{1, 0 < x < 1/2 || 1 < x < 3/2}, {0, false}}] ExpectedValue=Integrate[x f[x], {x, -Infinity, Infinity}] yields 3/4.


2

A good source are the Wolfram.com pages; http://mathworld.wolfram.com/search/?query=stochastic+models&x=17&y=14 http://search.wolfram.com/?query=stochastic+models&x=0&y=0 Not free, but gives you a good overview for the library; ...


5

You need ParameterMixtureDistribution: pmd = ParameterMixtureDistribution[NormalDistribution[µ, σ], µ \[Distributed] ExponentialDistribution[λ]] CDF[pmd, x]


5

You made several mistakes MyBinomialDistribution should be a function of n and p. There is only one variable k. n and p are parameters The correct definition is MyBinomialDistribution[n_, p_] := ProbabilityDistribution[Binomial[n, k] p^k (1 - p)^(n - k), {k, 0, n, 1}] PDF[BinomialDistribution[n, p], k] PDF[MyBinomialDistribution[n, p], k]


1

First look into the documentation to see if your distribution is already defined. If it is not, you can define your own distribution based on its PDF or CDF using ProbabilityDistribution. dist=ProbabilityDistribution[ C q^(4 n Nu - 1) (1 - q)^(4 n Mu - 1), {q, 0, 1}, ...] (This is incomplete, you need to define the ranges of the parameters) Whatever ...


1

If you go up two levels in the url's hierarchy, you can find a copy of the bayesian network library. Graphical models http://cs.brown.edu/research/ai/dynamics/tutorial/Documents/GraphicalModels.html tutorials including notebooks for most of the topics. http://cs.brown.edu/research/ai/dynamics/tutorial/home.html


3

If you use an intermediate function as demonstrated in this answer, you'll get rid of all error messages that are related to the symbolic evaluation: derivativeStrategyLongStraddleCompiled2[currentPrice_?NumberQ, strikePrice_?NumberQ, callPremium_?NumberQ, putPremium_?NumberQ] := derivativeStrategyLongStraddleCompiled[currentPrice, strikePrice, ...


1

You can apply your transformation to your sample data and use EmpiricalDistribution on the transformed data without having to use TransformedDistribution: data = RandomVariate[ExponentialDistribution[1], 10^4]; ed = EmpiricalDistribution[data]; edtr = EmpiricalDistribution[Sqrt@data]; Plot[{CDF[ed, x], CDF[edtr, x]}, {x, 0, 4}, PlotLegends -> ...


8

First I create a set of data to simulate yours. data = RandomVariate[ExponentialDistribution[1], 10^4]; Now you can take advantage of the EmpiricalDistribution function to define a model-free distribution based on your data. edist = EmpiricalDistribution[data]; The core of what you are asking for is to obtain a TransformedDistribution, i.e starting ...


6

Plot[PDF[WeibullDistribution[2, 3.5], x], {x, 0, 20}] data = {0.4, 0.7, 0.4, 0.8, 0.7, 0.7, 0.3, 0.1, 0.2, 0.3, 0.1, 0.7, 0.4, 0.7, 0.4, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.3, 0.9, 0.4, 0.4, 0.4, 0.4, 0.7, 0.1, 0.7, 0.7, 0.7, 0.7, 0.5, 0.7, 0.7, 0.4, 0.7, 0.5, 0.3, 0.9}; Show[ Histogram[data, Automatic, "PDF"], Plot[Tooltip[PDF[#, x], #], {x, ...


1

Straightforward method One can do it very efficient without rejections and loops (100-500 times faster than posted methods) n = 10000000; r2 = 0.1; AbsoluteTiming[ choise = RandomChoice[{π r2, 1} -> {0, 1}, n]; box = RandomReal[1, {n, 2}]; circle = Transpose@{0.5 + # Cos@#2, 0.5 + # Sin@#2} &[Sqrt@RandomReal[r2, n], RandomReal[2 π, n]]; pts ...


3

edistdata = Table[{x, CDF[EmpiricalDistribution[R], x]}, {x, R}]; cdfw[a_, b_, x_] := Simplify[CDF[WeibullDistribution[a, b], x], x > 0]; cdfe[a_, x_] := Simplify[CDF[ExponentialDistribution[a], x], x > 0]; cdfp[a_, b_, x_] := Simplify[CDF[ParetoDistribution[a, b], x], x > 0]; nlmw = NonlinearModelFit[edistdata, cdfw[a, b, x], {a, b}, x]; nlme = ...


2

FindDistributionParameters and EstimatedDistribution do not provide information to construct confidence intervals conveniently. A possible approach is to use NonlinearModelFit using the empirical cumulative distribution of the data as input and the CDF of WeibullDistribution as the model to be estimated. edistdata = Table[{x, CDF[EmpiricalDistribution[W], ...


2

Clear[custom]; When defining the custom distribution, include the parameter assumptions required for the custom distribution to be a valid distribution. custom[a_, b_] = ProbabilityDistribution[ (a/b) ((x/b)^(a - 1)) E^-(x/b)^a, {x, 0, Infinity}, Assumptions -> a > 0 && b > 0]; DistributionParameterAssumptions[custom[a, b]] a ...



Top 50 recent answers are included