Model Differences in Log Returns of Stock Prices
Model Differences in Log Returns of Stock Prices
apple = Differences[Log[FinancialData["AAPL", {{2008, 3, 10}, {2010, 3, 15}, "Day"}, "Value"]]];Fit a TsallisQGaussianDistribution to the data and compare against the fit with a NormalDistribution:
edist1 = EstimatedDistribution[apple, TsallisQGaussianDistribution[μ, β, q]]edist2 = EstimatedDistribution[apple, NormalDistribution[μ, σ]]DistributionFitTest[apple, #]& /@ {edist1, edist2}h = Histogram[apple, 30, "PDF"];
pdfs = Plot[{PDF[edist1, x], PDF[edist2, x]}, {x, -0.1, .1}, PlotStyle -> Thick, PlotLegends -> {"Tsallis", "Gaussian"}];
Show[{h, pdfs}, ImageSize -> 300]{QuantilePlot[apple, edist1], QuantilePlot[apple, edist2]}Probability[x > 0.1, xedist1]ListLinePlot[RandomVariate[edist1, 30], ImageSize -> 300]