Tag Info

New answers tagged

2

What looks like x is actually \[FormalX] (a dummy argument of the pure function). If you name that function (e.g., pdF= PDF[Transformed....]) you can use it as pdF[z] or pdF[y] etc. y = x^2; pdF = PDF[TransformedDistribution[y, x \[Distributed] ProbabilityDistribution[30*x^2 (1 - x)^2, {x, 0, 1}]]] pdF[z] pdF[1/2] // N (* 0.909903 *) ...


3

The event $x - y = t$ has probability 0. Mathematica is not smart enough to figure out how to compute the conditional probability you are after. Here is, however, a way in which you can get your desired CDF quite easily. Transform you problem from $\mathbb{P}[0 < x \le a]$ to $\mathbb{E}[\mathbb{1}_{0 < x \le a}\delta(x - y - t)]$ where $\delta(x)$ ...


4

You can use ProbabilityDistribution to define your own probability distribution from a CDF: dist = ProbabilityDistribution[{"CDF", 1/2 Erfc[(0.1 - x)/(Sqrt[2] 1.2)]}, {x, -∞, ∞}] With some data data = RandomVariate[NormalDistribution[], 50]; you can now perform KolmogorovSmirnovTest[data, dist]


2

The KS test looks for the maximum absolute deviation between empirical cdfs and so it is sensitive to departure in distribution anywhere. In your case there is very significant deviation in the tails. The null hypothesis is that the distributions are equivalent and, since the empirical distribution should well represent the underlying population ...


3

This is an addendum to kguler's answer. There is, to me, an inexplicable change in behavior of Commonest between V9 and V10. data = Permutations[{0, 0, 1, 1}] {{0, 0, 1, 1}, {0, 1, 0, 1}, {0, 1, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {1, 1, 0, 0}} V9 Commonest[#, 1] & /@ data {{0}, {0}, {0}, {1}, {1}, {1}} V10 Commonest[#, 1] & /@ data ...


4

Use the second argument of Commonest: Commonest[{0, 1, 1, 0}, 1] (* {0} *) Docs on Commonest>>Details: Commonest[list,n] returns the n commonest elements in the order they appear in list. Update: As discovered by m_goldberg (see this answer) and fixed by Mr.Wizard (see this Q/A, Commonest has a bug in Version 10. So, for Version 10, you need to ...


2

Using sim[length_] := Module[{rv = RandomVariate[BetaDistribution[2, 1], length], y, yMed}, y[1] = First@rv; yMed[t_Integer] := yMed[t] = Median[y /@ Range[t]]; y[t_Integer] := y[t] = f[0.5, {rv[[t]], yMed[t - 1]}]; yMed /@ Range[length] ] results in plots like Here Median[y /@ Range[t]] calculates the median for y[1] to y[t], as stated ...


1

As you requested in your edit, @Mr.Wizard's answer shows how to perform listwise deletion (= corr in Stata). An alternative is to perform pairwise deletion (= pwcorr). In a comment above you note that some variables have many missing values; in my opinion this indicates you may want to consider pairwise deletion so that you are not throwing out a lot of ...


3

Hopefully I don't misunderstand but I think this will be of help: SeedRandom[0] d1 = {Range[#], RandomInteger[99, #], RandomInteger[1, #]}\[Transpose] &[20] {{1, 83, 1}, {2, 66, 1}, {3, 4, 0}, {4, 21, 0}, {5, 71, 0}, {6, 67, 1}, {7, 16, 1}, {8, 67, 0}, {9, 76, 1}, {10, 28, 1}, {11, 21, 1}, {12, 43, 1}, {13, 17, 0}, {14, 46, 0}, {15, 53, 0}, ...


8

Take a look at this. Let's generate some data with missing entries: data = Table[9 k + RandomInteger[9, 10], {k, 10}] /. Thread[RandomInteger[99, 5] -> Missing[]]; data // TableForm Build TemporalData object and select replacement method for missing points: td = TemporalData[data, {Range[10]}, MissingDataMethod -> {"Interpolation", ...



Top 50 recent answers are included