Tag Info

Hot answers tagged

5

Alex Isakov has a Granger Causality Test in his Economica Time Series package here:- http://www.alexisakov.com/p/economica.html I'm not very familiar with the details, but I ran some tests using data from here:- http://davegiles.blogspot.co.uk/2011/04/testing-for-granger-causality.html Having downloaded the data. arabica = Last /@ ...


4

There doesn't seem to be so much a problem with the fitting method. Your model is actually linear, but values of zero are problematic for it. Quoting from J. Johnston's Econometric Methods, edition 3, page 13: A linear specification means that Y, or some transformation of Y, can be expressed as a linear function of X, or some transformation of X. ...


4

Kuba answered this question in a comment, but I think it needs to be recorded as a formal answer. You can animate your static plot by wrapping it with Dynamic and supplying the option UpdateInterval. data := RandomVariate[WignerSemicircleDistribution[1, 3], 10^4]; Dynamic[ Show[ Histogram[data, 20, "PDF"], ...


3

If the data and the error follows a power law, it makes sense to do the fit in log log space. To do that I'm dropping zero/negative data: newData = Select[ Table[{q, 2*q^2*RandomReal[{0.80, 1.2}]}, {q, 0, 2, 0.01}] , #[[1]] > 0 && #[[2]] > 0 &] ; newModel = NonlinearModelFit[Log[newData], a*q + b, {a, b}, q, Method ...


3

Change the method used by NIntegrate: pdf[s_?NumericQ] := combn NIntegrate[ N[q^k (1 - q)^(n - k), 100] (E^(4 n q s) (1 - q)^(-1 + 4 n \[Mu]) q^(-1 + 4 n \[Nu]))/ NIntegrate[ E^(4 n q s) (1 - q)^(-1 + 4 n \[Mu]) q^(-1 + 4 n \[Nu]), {q, 1/(2 n + 1), 1 - 1/(2 n + 1)}, MaxRecursion -> 12, Method -> ...


3

Since you are flipping the coin 10 times, trailheadcount can assume only the values Range[0,1,.1]. Thus, the expression .4 < Apply[Plus, Table[X, {n}]]/n < .6 only selects the value 0.5. Indeed, the probability of 0.5 is about 0.246. Undoubtedly, you meant .4 <= Apply[Plus, Table[X, {n}]]/n <= .6, which selects values {0.4,0.5,0.6}. With this ...


2

If you just perform the experiment correctly ... Count[Tr /@ RandomInteger[{0, 1}, {1000000, 10}], Alternatives[4, 5, 6]] (* 656190 *)


2

Perhaps: data = {0, 0, 0, 0, 80, 100, 120, 130, 130, 140, 140, 150, 150, 160, 170, 200, 220, 240, 350}; {mean, std} = Through@{Mean, StandardDeviation}@data; You can specify the bin delimiters as an explicit list: bins = {Table[mean + k std, {k , -5/2, 5/2, 1}]}; Histogram[data, bins, Epilog -> {PointSize[Large], Red, Point@{mean, 0}}] ...


2

data := RandomVariate[WignerSemicircleDistribution[1, 3], 10^4]; Dynamic[Clock[{0, 5, 1}, 1]; Histogram[data, 20, "PDF", ChartStyle -> EdgeForm[White], Axes -> False, PlotRange -> {{-4, 6}, {0, .25}}, ImageSize -> 400, Frame -> True, Epilog->First[Plot[PDF[WignerSemicircleDistribution[1, 3], x], {x, -4, 6}, PlotStyle->Thick]]]]


1

First let's define the needed variables: n = 100; ρ = RandomReal[1, {n}]; σ = RandomReal[1, {n}]; noise = RandomVariate[NormalDistribution[], n]*σ; Note that in order to get the noise, I multiply a list of noises drawn from a standard normal by the standard deviations. This is much faster than calling RandomVariate hundreds of times. Now here's the ...


1

It might be that you require a parametric process, the transformed process might not fit the bill. As a workaround how about doing this?Take the data back to a parametric process. S = TransformedProcess[Exp[P[t]], P \[Distributed] ARProcess[0, {0.5}, 1], t]; test = RandomFunction[S, {0, 1000}]; EstimatedProcess[TimeSeriesMap[Log, test], ARProcess[c, ...


1

Far from what the OP asked... Crude table based linear interpolation approach to learning more about the PDF: n = 25000; k = 24991; \[Mu] = 10^-4; \[Nu] = 10^-4; q = k/n; combn = Binomial[n, k]; pdf[s_?NumericQ] := combn NIntegrate[N[q^k (1 - q)^(n - k), 100] (E^(4 n q s) (1 - q)^(-1 + 4 n \[Mu]) q^(-1 + 4 n \[Nu]))/ NIntegrate[E^(4 n q s) (1 - ...


1

Yes, you are just inputing the data wrong. ANOVA in mathematica needs to labeled. I assume you are just placing the list list ={{2.749, 2.649, 2.689, 2.679, 2.679, 2.699, 2.699, 2.699, 2.749, 2.749, 2.779, 2.799, 2.799, 2.799, 2.799, 2.799, 2.799, 2.799, 2.799}, {2.849, 2.9465, 2.899, 2.899, 2.899, 2.849, 2.824, 2.859, 2.899, 2.897, 2.899, 2.849, 2.824, ...


1

I am not sure if I understand you correctly but you can try this: f[sclx_, scly_] := scly*PDF[StudentTDistribution[1], x/sclx] Plot[{f[1, 1], f[2, 3]}, {x, -8, 8}]


1

Use E rather than e {xlow, xhigh} = {0, Infinity}; Clear[pdf, x, t]; pdf[x_] := 2 E^(-2 x) You can use xhigh (i.e., Infinity) in a function like Integrate Integrate[pdf[x], {x, xlow, xhigh}] 1 However, a Plot must be on a finite domain Plot[pdf[x], {x, xlow, 6}, PlotStyle -> {{Thickness[0.01], Purple}}, AxesLabel -> {"x", "pdf[x]"}, ...


1

I interpret your question as focusing on the method of graphing, not the specifics of the GARCH algorithm. As such, here is a time series, the variance (calculated on five sequential points), and the moving averages, and a combined ListPlot. myTimeSeries = Table[.3 Sin[.1 i] + RandomReal[], {i, 1, 100}]; myVariances = Variance /@ Partition[myTimeSeries, ...


1

Just another approach (assuming fair coin): bd = BernoulliDistribution[0.5]; rv = RandomVariate[bd, {1000000, 10}]; Length@Pick[rv, 4 <= Total@# <= 6 & /@ rv]/1000000. yields: 0.657009


1

The best approach is to exploit the powerful statistical functions in Mathematica. Here's the basic probability of getting between 4 and 6 heads (inclusive) in 10 flips of a fair coin: Probability[4 <= x <= 6, x \[Distributed] BinomialDistribution[10, .5]] (* 0.65625 *) And here is a plot of that discrete distribution: ...



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