New answers tagged

1

You may use TimeSeriesWindow. TimeSeriesWindow[temp, {1, 2}] (* TemporalData[Time: 1 to 2 Data points: 2 Paths: 1] *) TimeSeriesWindow gives the events the fall between the window specified. Hope this helps.


5

We can operate upon data contained within dataset by applying query operators. Assume that the dataset described in the question has been assigned to the variable ds. Then, for example, we can convert the embedded association into an event series by applying the EventSeries operator: ds[EventSeries] Alternatively, we could produce a plot by composing ...


1

The code below was written with the assumption that you want to keep your data within TimeSeries objects. (Since you mention "time-series data" and TimeSeriesAggregate.) That is not necessary with the regular grid of dates in the data you provided; you could use simple lists of numbers instead. Q1 You can redefine LogReturn accordingly. Clear[LogReturn] ...


4

Dataset has only been around since version 10.0, and not all functions support it as yet. However, Association has much broader support and is what Dataset is based on. You can use Normal to convert the Dataset into an Association. EventSeries can work with associations. With ds as the Dataset in the above post, then EventSeries[Normal@ds] (* ...


1

You can reformat the absolute very easily and you have almost any format that you want. Look at DateString for the large range of date and time element formats available. Here is a function that will handle your data. toDateString[{arg1_, arg2_}, fmt_] := {DateString[arg1, fmt], arg2} Examples With[{ item = {3538468800, 6738.89}, fmt = {"...


2

ts = FinancialData["NYSE:GS", "Price", {{2012, 1, 1}, {2013, 1, 1}}]; total = TimeSeriesAggregate[ts, "Quarter", Total]; Note that you need ts rather than data in definition of total (total2 = MapAt[DateString[#, {"MonthNameShort", "-", "YearShort"}] &@* DateList, total, {All, 1}]) // Grid


2

rawData = {{"13/12/2010", 10}, {"15/12/2010", 20}, {"17/12/2010", 30}, {"19/12/2010", 40}, {"21/12/2010", 50}, {"23/12/2010", 60}, {"13/12/2011", 80}, {"15/12/2011", 70}, {"17/12/2011", 60}, {"19/12/2011", 40}, {"21/12/2011", 50}, {"23/12/2011", 60}, {"13/12/2012", 10}, {"15/12/2012", 20}, {"17/12/2012", 30}, {"19/12/2012", 20}, {"21/12/2012", ...


2

(data = {{Date, Price}, {"16/05/2007", 3655}, {"16/06/2007", 3435}, {"16/07/2007", 3528}}) // Grid (data2 = MapAt[DateList[{#, {"Day", "Month", "Year"}}] &, data, {2 ;;, 1}]) // Grid


2

Multivariate support for TimeSeriesModelFit is not currently implemented (version 10.4.1.). Here is way to generate multi-variate data using the first, single variable example in the function page of TimeSeriesModelFit. data = {5., 9., 8., 10., 6.1, 10.4, 9.1, 11.6, 7.5, 12.1, 10.4, 13.5, 9., 14.1, 11.9, 15.7, 10.8, 16.4, 13.7, 18.3, 12.9, 19., 15.8, ...


6

data = RandomReal[{-1, 1}, 10]; ts = TimeSeries[data, Automatic]; es = EventSeries[data, Automatic]; First/@{es, ts} {EventSeries, TimeSeries} or eventSeriesQ = First@#===EventSeries & eventSeriesQ/@{es, ts} {True, False}


3

data = Import["data.dat", "List"] tsm = TimeSeriesModelFit[data, "AR"] Normal[tsm] Result: ARProcess[0.00435059, {1.41701, -0.0804567, -0.245416, -0.0753475, -0.0415635}, 5.10131*10^-7] Then you can read off the coefficients and noise variance.


0

Given two TimeSeries (ts1 and ts2), I was able to speed up my results about 60x with the following: paths=Map[#["Path"] &, {ts1,ts2}]; commonDates=Intersection[paths[[1, All, 1]], paths[[2, All, 1]]]; fakeDatepath=Transpose[{commonDates, Table[-1, {Length[commonDates]}]}]; shortPaths=Map[(TemporalData[Intersection[#, fakeDatepath, SameTest -> (#1[[...



Top 50 recent answers are included