Question

I am using forecast package for time series analysis. I have a dataset with hourly data...

I am using forecast package for time series analysis. I have a dataset with hourly data from oct 3 2016 to oct 23 2016. I used the following code to convert my data into a time series object.

Dataset is about citibike stations I’m only using 6 stations

I’m not sure if Im supposed to use my time column or include my time column.

This is what i have so far.

data.ts <- ts(CitiBike[,2:7], freq = 504, start = 2016)

I think my start is incorrect because the days and time are not showing

How should my code look like for using r programming

I’m trying to predict 3 hours

Homework Answers

Answer #1

#----------------please find below code to convert any date format-------------------------#

date_vector <- as.vector(TSdata$Date)
date_format <- dateformat(date_vector)
print(paste("Date format identified as ",date_format,sep=""))
TSdata$Date <- date_handle(date_vector, date_format)
TSdata <- TSdata[order(TSdata$Date),]
str(TSdata)

#---------------------Transformation of the date data into time series------------------------------------#

TSdata=ts(TSdata[,2],start=c(2003,1),frequency=12)
start(TSdata)
end(TSdata)
frequency(TSdata)
StructTS(TSdata)
TSdata

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions