Hi Brian,
Thank you for the suggestions. I agree that the plot can be difficult to
discern. I also like histograms as a way of showing density / distribution.
The raw data is just a sequence of numbers
These are the last ten numbers from this morning: 1413871486405
1413871486815 1413871486865 1413871487305 1413871487625 1413871487716
1413871487786 1413871488006 1413871488537 1413871505926
These can be converted into a more readable timestamp with:
tsFrom1970 every 1413871486405 1413871486815 1413871486865 1413871487305
1413871487625 1413871487716 1413871487786 1413871488006 1413871488537
1413871505926
2014 10 21 6 4 46.405
2014 10 21 6 4 46.815
2014 10 21 6 4 46.865
2014 10 21 6 4 47.305
2014 10 21 6 4 47.625
2014 10 21 6 4 47.716
2014 10 21 6 4 47.786
2014 10 21 6 4 48.006
2014 10 21 6 4 48.537
2014 10 21 6 5 5.926
I updated the wiki article with a function to break it into 24 hour
segments:
hours24=:((<.@:(86400000%~ (-~ >./))) </. ])
> (#;(tsFrom1970@{.)) each hours24 times
24 step counts (probably not real "steps" yet)
┌─────┬───────────────────────┐
│1289 │2014 10 11 20 39 46.568│
├─────┼───────────────────────┤
│22159│2014 10 12 6 54 8.738 │
├─────┼───────────────────────┤
│6313 │2014 10 13 6 33 8.083 │
├─────┼───────────────────────┤
│12828│2014 10 14 6 48 11.6 │
├─────┼───────────────────────┤
│9071 │2014 10 15 6 36 1.92 │
├─────┼───────────────────────┤
│18164│2014 10 16 6 16 4.375 │
├─────┼───────────────────────┤
│7406 │2014 10 17 6 7 15.452 │
├─────┼───────────────────────┤
│19393│2014 10 18 6 7 53.378 │
├─────┼───────────────────────┤
│20901│2014 10 19 6 29 59.583 │
├─────┼───────────────────────┤
│13380│2014 10 20 6 30 4.584 │
└─────┴───────────────────────┘
We can calculate the longest period at rest with this:
longestTime=:(24 60 60 1000)&#: @ (- @ {. @ ([: /:~ 2(-/)\]) )
longestTime every hours24 times
0 11 14 992
4 40 3 292
4 15 43 76
5 34 24 55
5 57 50 999
5 15 42 587
4 41 48 842
7 42 43 662
6 27 7 968
3 59 57 531
For the longest period of rest, I now need to solve the problem of
eliminating noise from the interval. For example, I'd like to eliminate
steps that don't have more than 5 consecutive steps in 5 seconds.
On Tue, Oct 21, 2014 at 1:24 PM, Brian Schott <[email protected]>
wrote:
> Joe,
>
> I gather that data is 2 boxed lists. The first box contains the day number
> and the second box contains a point in time between 0 and 24*60*60. The
> latter indicate when a step was taken. Furthermore, both boxes are numbers`
> in nondecreasing order. Right?
>
> In place of your plot I am very tempted to break up the time points for
> each day into counts of equal intervals kind of like histograms are created
> and make a histogram/frequency distribution for each day, where the
> histogram bins are really time slots. My reason for not liking the plots is
> that the points are so close together in many regions that you cannot
> detect any distinctions between the various days.
>
> At http://jsoftware.com/help/dictionary/dicapdot.htm the histogram verb is
> quite effective at this, but seems to be overkill because your data seem to
> already be sorted.
>
>
>
>
> On Tue, Oct 21, 2014 at 7:44 AM, Joe Bogner <[email protected]> wrote:
>
> > I've been collecting accelerometer/pedometer data for the last week. I've
> > posted a wiki article[1],
> > http://www.jsoftware.com/jwiki/JoeBogner/AccelerometerAnalysis , that
> I'd
> > like to expand, but I'm realizing it's beyond what I can easily do in J.
> >
> > I'm interested in any feedback on how you would approach the questions
> > stated:
> >
> > 1.) How long do I sleep each night, when do I wake up?
> > 2.) How active am I during the day -- what are my longest periods of
> > sitting?
> > 3.) Detect the most active periods in the day. I often go running or take
> > 30 minute walks with the kids. Can we identify those times?
> >
> > Feel free to add any questions that you would find interesting if it was
> > your data.
> >
> > Thank you for any feedback / contributions
> >
> > Joe
> >
> >
> > [1] - http://www.jsoftware.com/jwiki/JoeBogner/AccelerometerAnalysis
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
>
> --
> (B=) <-----my sig
> Brian Schott
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm