Skip to content

Reg: Frequency in declaring time series data

2 messages · Upananda Pani, Eric Berger

#
Hi Rui,

Thank you so much for your help. As I have to fit a Markov Switching Model
using  MSwM package.

May I know whether i can convert from zoo object to a time series object.

As I have to use several packages which uses ts so I am not able to decide
how to do it.

Grateful to you for your help and support.

With sincere regards,
Upananda
On Tue, 17 Jan, 2023, 01:40 Rui Barradas, <ruipbarradas at sapo.pt> wrote:

            

  
  
#
Hi Upananda,
A few comments:
1. As you know, CRAN has thousands of packages. One of the ways to
learn about the packages you might care about is to use the CRAN
views. A 'view' is an attempt to provide some information on a certain
subset of the packages related to a particular area.
See a list of the views at: https://cran.r-project.org/web/views/
2. In your case, you might be interested in the 'Time Series' view:
https://cran.r-project.org/web/views/TimeSeries.html
3. On that page, the subsection 'Time Series Classes' mentions two
packages, 'tsbox' and 'timetk' which provide tools to convert between
different representations of time series used in different packages. I
have not used either of these packages, but perhaps they could be of
use to you.
4. For financial time series, it is often useful to have the exact
dates. Rui mentioned the zoo package. I often use the xts package.
xts = eXtensible Time Series. The xts package is an extension of the
zoo package.
5. If your data is coming from market prices, and you have daily data
corresponding to market prices, then presumably you don't have weekend
or holiday prices (when the markets are closed). This leads to about
250 or 252 trading days per year (52 weeks X 5 days/wk = 260, minus
8-10 holidays). It is standard in financial calculations to annualize
based on 250 or 252. So, you might want to specify a frequency of 250
or 252 in your time series when creating a ts object.

I hope that helps,
Eric
On Tue, Jan 17, 2023 at 6:29 PM Upananda Pani <upananda.pani at gmail.com> wrote: