Tag Info

New answers tagged

5

I guess this is approximately what you want: ListLogPlot[ FindClusters[Standardize@mydata, 3, Method -> {"Agglomerate", "Linkage" -> "Complete"}] /. Thread[Standardize@mydata -> mydata], PlotStyle -> {Directive[Red, PointSize[Large]], Directive[Blue, PointSize[Large]], Directive[Green, ...


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", ...


3

It appears to be a bug in the reporting mechanism. The individual components x and y are being tested for normality but the reported value is that of a joint test for multivariate normality. The conclusion is correct, the message is wrong. SeedRandom[2154]; x = RandomReal[{-5, 5}, 100]; y = 2 x + 1 + RandomReal[{-0.1, 0.1}, 100]; X = Transpose[{x, y}]; ...


5

With f[a_, {x_, y_}] := Piecewise[{{a x, x < y}, {x, x == y}, {1 - a + a x, x > y}}, 0] one simulation can be defined by sim[length_] := Module[{rv = RandomVariate[BetaDistribution[3, 1], length], y, yBar}, y[1] = First@rv; yBar[t_Integer] := yBar[t] = 1/t * Sum[y[i], {i, 1, t}]; y[t_Integer] := y[t] = f[0.5, {rv[[t]], yBar[t - 1]}]; ...


5

Another way to use OrderDistribution: use the joint distribution of largest three order statistics in a sample of size four: dist = OrderDistribution[{UniformDistribution[], 4}, {2, 3, 4}]; Expectation[x + y + z, {x, y, z} \[Distributed] dist] (* 9/5 *)


1

Citing this Demonstration by Darren Glosemeyer (Wolfram Research): Single prediction bands incorporate both the variation in parameter estimates and the overall variation in response values, while the mean confidence bands incorporate only the variation in parameter estimates. As a result, single prediction bands are wider than mean prediction ...


1

With the function f[a_, {x_, y_}] := Piecewise[{{a x, x < y}, {x, x == y}, {1 - a + a x, x > y}}, 0] you can define a new function, that will perform a single simulation sim[a_Real, n_Integer] := Module[{data = Partition[Riffle[#, Accumulate[#]/Range[n]], 2] &@ RandomVariate[BetaDistribution[3, 1], n]}, f[a, #] & /@ data ] where the ...


0

You can try package I have written for estimating garch process parameters -although it's not finished yet but you can estimate around 10 kinds of garch processes.Just type Ugarch in documentation when you install the package.Any feedback is more than welcome. https://www.4shared.com/zip/Rb7AXlxYba/garch.html These are actually ported R functions package ...


4

Here is a quick (and dirty?) implementation of the Laplace distribution. Relationship to the uniform distribution as given on Wikipedia: randomLaplace = With[{$MachineEpsilon = $MachineEpsilon}, Compile[{{µ, _Real, 0}, {b, _Real, 0}, {n, _Integer, 0}}, With[{u = RandomReal[{-1/2, 1/2} (1 - $MachineEpsilon), n]}, µ - b Sign[u] Log[1 - 2 Abs[u]] ] ...


8

Another option to the answer posted by @Andy Ross cropped up in a recent question of mine about corrupting an image with Poisson noise. In my own answer, I made use of LibraryLink to utilise the distributions built into C++, which you can find here: http://www.cplusplus.com/reference/random/ This was especially useful in my case because Poisson noise in an ...



Top 50 recent answers are included