TimeSeries?

1 view
Skip to first unread message

Colin Dilwoth

unread,
May 19, 2011, 7:17:53 PM5/19/11
to 480uw11
Declaring an array with stats.TimeSeries gives an error. I found
somewhere that finance.TimeSeries seems to calculate mean as well. Is
that ok to use? If not, how do we use stats.TimeSeries?

Colin Dilwoth

unread,
May 19, 2011, 7:25:21 PM5/19/11
to 480uw11
So, I found out that finance.TimeSeries doesn't have the median
attribute.

William Stein

unread,
May 19, 2011, 7:58:55 PM5/19/11
to 480...@googlegroups.com
On Thu, May 19, 2011 at 4:17 PM, Colin Dilwoth <colind...@gmail.com> wrote:
> Declaring an array with stats.TimeSeries gives an error.

I don't understand your question:

sage: stats.TimeSeries([1..100])
[1.0000, 2.0000, 3.0000, 4.0000, 5.0000 ... 96.0000, 97.0000, 98.0000,
99.0000, 100.0000].

> I found
> somewhere that finance.TimeSeries seems to calculate mean as well. Is
> that ok to use? If not, how do we use stats.TimeSeries?

They are exactly the same thing:

sage: finance.TimeSeries is stats.TimeSeries
True


--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

William Stein

unread,
May 20, 2011, 1:42:52 AM5/20/11
to Nasim Shomali, 480uw11
On Thu, May 19, 2011 at 9:39 PM, Nasim Shomali <nsho...@gmail.com> wrote:
> Professor Stein,
> Colin asked this question earlier to the google group but I don't think it
> was responded to. What are we suppose to use for median when using the
> stats.TimeSeries module? The standard deviation and mean are working but I
> can't find a median function anywhere.

You should just indicate in this case that TimeSeries does not support median.
Sorry for not realizing this when writing the question.

William

> Thanks,
> Nasim

> --
> Nasim Shomali
> Depts. of Bioengineering & Mathematics
> University of Washington
> nsho...@u.washington.edu

Colin Dilwoth

unread,
May 20, 2011, 2:17:40 AM5/20/11
to 480uw11
Thanks Professor Stein. I don't know why it wasn't working for me.
Maybe I just typed something wrong, but it's working now.

On May 19, 10:42 pm, William Stein <wst...@gmail.com> wrote:
> On Thu, May 19, 2011 at 9:39 PM, Nasim Shomali <nshom...@gmail.com> wrote:
> > Professor Stein,
> > Colin asked this question earlier to the google group but I don't think it
> > was responded to. What are we suppose to use for median when using the
> > stats.TimeSeries module? The standard deviation and mean are working but I
> > can't find a median function anywhere.
>
> You should just indicate in this case that TimeSeries does not support median.
> Sorry for not realizing this when writing the question.
>
> William
>
>
>
>
>
>
>
>
>
> > Thanks,
> > Nasim
>
> > On Thu, May 19, 2011 at 4:25 PM, Colin Dilwoth <colindilwo...@gmail.com>
> > wrote:
>
> >> So, I found out that finance.TimeSeries doesn't have the median
> >> attribute.
>
> >> On May 19, 4:17 pm, Colin Dilwoth <colindilwo...@gmail.com> wrote:
> >> > Declaring an array with stats.TimeSeries gives an error. I found
> >> > somewhere that finance.TimeSeries seems to calculate mean as well. Is
> >> > that ok to use? If not, how do we use stats.TimeSeries?
>
> > --
> > Nasim Shomali
> > Depts. of Bioengineering & Mathematics
> > University of Washington
> > nshom...@u.washington.edu
Reply all
Reply to author
Forward
0 new messages