I have 5 years stock closing price of a company with some missing values in between (I having 1443 data points).

When I create timeseries object in R with frequency 365 it creates 1834 data points, R is imputing these missing values for timeseries object but can anyone help me how it is imputing them? like what formula is used? Also if i don't want to impute these missing values is it possible in R?

R command used:

st_ts = ts(stocks[,2],start = c(2010,1),end = c(2015,9),frequency = 365) 

enter image description here

enter image description here

  • 1
    $\begingroup$ Isn't the time series package already inputting missing data point for you? Or does it assume the last 397 are empty only? can you include a plot of this timeseries object in your question? $\endgroup$ – SRKX Oct 20 '15 at 8:18
  • 1
    $\begingroup$ yes it does but how do i know what values and how it imputes for large datasets? $\endgroup$ – alily Oct 20 '15 at 8:32
  • $\begingroup$ Hi SRKX yes i have looked in that object it is giving different values for different missing fields ,but i did not understand how i is imputing those values so i asked this question $\endgroup$ – alily Oct 20 '15 at 8:40
  • $\begingroup$ ok so it seems the data are repeated, and it seems you're original set only has about 300 points... $\endgroup$ – SRKX Oct 20 '15 at 8:40
  • $\begingroup$ ts is probably not the right package for you, have a look at this page for more info. $\endgroup$ – SRKX Oct 20 '15 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.