Tag Info

New answers tagged

6

Module[{data, range}, data = TimeSeries[#, ResamplingMethod -> {"Constant", 0}] &@{{1891, 1}, {1892, 1}, {1897, 1}, {1898, 1}, {1903, 1}, {1904, 1}, {1905, 1}, {1908, 4}, {1909, 6}, {1910, 6}, {1911, 16}, {1912, 33}, {1913, 35}, {1914, 43}, {1915, 39}, {1916, 31}, {1917, 42}, {1918, 52}, {1919, 44}, {1920, 53}, {1921, 33}, ...


2

Thanks to rasher's answer to Unragging a matrix I have written: PreFill := Module[{t = ConstantArray["x", Length@Dates], p = #[[All, 1]] /. Dispatch@Thread@Rule[Dates, Range@Length@Dates]}, t[[p]] = #; t] & Filler[dt_] := Module[{f, pr}, f[x_, "x"] := x; f[_, x_] := x; pr = FoldList[f, FoldList[f, #][[-1 ;; 1 ;; -1]]][[-1 ;; ...


4

The only elegant thing I've found that can be done for this question is the shifting of the time series with TimeSeriesShift to help get the answer. {pepsi, mcds} = TimeSeries[FinancialData[{"NYSE", #}, "Price", {DateObject[{2012, 12, 31}], DateObject[{2015, 3, 31}], "Week"}]] & /@ {"PEP", "MCD"} Get to time series. TimeSeriesShift will shift ...


3

Using "Values" you can extract the numerical values of the time series and perform whatever statistical analysis you want on them. For example, if the TimeSeriesare financial data: data1 = FinancialData["SBUX", "Close", {{2013, 1, 1}, {2013, 12, 1}, "Day"}]; data2 = FinancialData["SBUX", "Close", {{2013, 5, 1}, {2013, 6, 1}, "Day"}]; ts1 = ...


1

This is not a bug, but an intended design change. The motivation is that TimeSeries is meant for those time-series that support resampling. Zero order interpolation is supported, example: TimeSeries[Range[3], Automatic, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 0}] If your time series is not meant to support resampling then ...



Top 50 recent answers are included