Tag Info

New answers tagged

1

For instance, if I have a process and it first spends 2 minutes in state 1, then 200 minutes in state 2 and 10 minutes in state 0: {{0,0},{2,1}, {202, 2}, {212,0}} I would want the time be included in the calculation of the relative frequency as opposed to the number of occurences. Based on this description, I can suggest the following approach: ...


2

RandomFunction produces a TemporalData object. The action of Histogram on TemporalData is to just do a histogram of the values (ignoring time stamps). td = RandomFunction[QueueingProcess[3, 5], {0, 15}]; GraphicsRow[{Histogram[td], Histogram[td["Values"]]}] Thus, you can either wrap your data in TemporalData or just make a histogram of the values ...


2

Just to add some more options and expose some other time series functionality. TimeSeriesSplit[ts_, dt_, align_: None] := Block[{f, tsa, dates}, tsa = Sequence @@@ (TimeSeriesAggregate[ts, dt, f]["Values"]); dates = Internal`PartitionRagged[ts["Dates"], Length /@ tsa]; If[align =!= None, TemporalData[tsa, {dates[[1, 1]], Automatic, align}] , ...


2

Just for reference, I will post the code I used for the final solution. It wouldn't have been possible without PatoCriollo's help: tdata = TemporalData[data[[All, 2]], {Map[DateString, data[[All, 1]]]}]; ds = TimeSeriesWindow[tdata, {{#, 1}, {#, 12}}] & /@ Range[1991, 2008]; ListPlot[ds[[#]]["Values"] & /@ Range@Length@ds, Joined -> True, ...


4

With version 10 data = WeatherData["KATL", "Temperature", {{2004, 1}, {2014, 10}, "Month"}] ds = TimeSeriesWindow[data, {{#, 1}, {#, 12}}] & /@ Range[2004, 2014]; ListPlot[ds[[#]]["Values"] & /@ Range@Length@ds, Joined -> True, Ticks -> {Transpose[{Range[12], {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", ...



Top 50 recent answers are included