Tag Info

New answers tagged

3

The original poster ponders why, in a bivariate model, the SmoothKernelDistribution function ... using the Silverman 'rule of thumb' estimate of bandwidth ... yields results that do not match the original poster's calculations. I had the same issue in a univariate form. Short version It turns out that there are two versions of the Silverman rule of thumb ...


6

I'd like to add to my previous comment that the undocumented "Bandwidth" property exists for SmoothKernelDistribution (SKD) and KernelMixtureDistribution (MKD). Note that in the multivariate case there is a bit of inconsistency in how this is currently handled for SKD vs. KMD. SKD simplifies the bandwidth matrix when the off-diagonal elements are zeros. ...


1

Finally, I think I found it--or, at least, I found a formula "close enough" to the way Mathematica calculates the BW by default: hi = ((4*Subscript[\[Sigma], i]^5)/(3*n))^(1/5) where \[Sigma] is the standard deviation of the data. This should be performed to each component (e.g. i, j, k) of the dimensions. The reference came from the folowing link: ...


8

If $X\sim N\left(\mu ,\sigma ^2\right)$ and $Y=e^X$, then $Y\sim \text{Lognormal}(\mu ,\sigma )$. So, by selecting LogNormalDistribution[10, 10], you are effectively generating values from a $N(10, 100$) distribution (which is a very large variance), and then raising them to $e^X$ ... which will generate deliciously large variates. To see this: Here are 6 ...


2

f2[x_, mu2_, sigma2_] := 1/Sqrt[2*sigma2^2]*Exp[-Sqrt[2]*Abs[(x - mu2)/sigma2]] Integrate[x*f2[x, mu, h], {x, -Infinity, Infinity}, Assumptions -> {Element[mu, Reals], h > 0}] (* mu *) Edit Let's make what he did wrong crystal clear to the OP. Should have used SetDelayed (:=) rather than Set (=) when defining f2. Needed to have an ...


0

One way to circumvent it is like this f2[x_, mu2_, sigma2_] := Piecewise[{{1/Sqrt[2*sigma2^2]*Exp[-Sqrt[2]*((x - mu2)/sigma2)], x - mu2 >= 0}, {1/Sqrt[2*sigma2^2]*Exp[-Sqrt[2]*((mu2 - x)/sigma2)], x - mu2 < 0}}] Integrate[x*f2[x, mu, sigma], {x, -Infinity, Infinity}, Assumptions -> sigma > ...


0

As I said in a comment, I'm not an expert on probability, but you can calculate the variance of a distribution with Variance: Variance[TransformedDistribution[ If[\[FormalX] == 1, 1 - 2 k, -1], \[FormalX] \[Distributed] BernoulliDistribution[p]]] // Simplify (* -4 (-1 + k)^2 (-1 + p) p *)



Top 50 recent answers are included