[R-SIG-Finance] Imputing Missing Values

Pankaj K Agarwal pankajsbi at yahoo.com
Sun Jun 26 15:22:04 CEST 2016


Dear FrankSo kind of you to have replied. Thanks.I am conducting an academic research on mutual funds. I am modelling fund returns on daily as well as monthly frequencies. The model uses zero investment strategy returns (fund/portfolio returns minus risk free rate) as variables. For risk free rates i have good quality 91-day t-bill rates available. But it appeared that using 91-day risk free rate with daily fund returns is not a very good idea, and i needed to search t-bill rates of lesser maturity. So, in India next lower maturity available is 14-day t-bill, but there are missing values for some months in the monthly series of annualized rates. For example, in some years, data for 3 months running is missing. Hope i could convey the problem.
Will na.locf be a good idea in this case? Also, if i use 91-day rates with daily fund returns, will it matter much?Kindly advise.
 Regards,Pankaj

 

    On Sunday, 26 June 2016 6:39 PM, Frank <frankm60606 at gmail.com> wrote:
 
 

 1)

I use na.locf to replace NAs from FRED. I believe na.rm=TRUE means next
observation is carried backward: 

library(quantmod)
library(chron)


##
## Get DGS3MO Treasury yield from FRED
##

getSymbols('DGS3MO',src='FRED')
DGS3MO<-na.locf(DGS3MO/100.0,na.rm = TRUE)
tail(DGS3MO)
file_name <- "DGS3MO.csv"
write.zoo(DGS3MO, file = file_name, append = FALSE, quote = TRUE, sep = ",")
quit()

2)

Would you be so kind as to show what you are currently using to imply
yields? And what is your intended use for the implied daily/monthly data.

Thanks,

Frank
Chicago
-----Original Message-----
From: R-SIG-Finance [mailto:r-sig-finance-bounces at r-project.org] On Behalf
Of Pankaj K Agarwal via R-SIG-Finance
Sent: Sunday, June 26, 2016 7:53 AM
To: R-sig-finance; R-Finance
Subject: [R-SIG-Finance] Imputing Missing Values

This might be a very basic query for this erudite group. However, i am
hopeful some help will be forthcoming nevertheless.I have a monthly time
series of annualized t-bill rates on Indian markets. For some months, the
values are missing randomly. I need to convert the annualized yields into
daily as well as monthly yields. I have two questions:1. I am using package
zoo. Which of the methods of NA imputations will be advisable for this
series, viz., na.agggregate, na.locf, na.spline or na.approx etc.?2. Should
the imputation be done on monthly annual yields and then the conversion to
daily and monthly yields be performed or imputation be done afterwards?3.
Are there better methods than above for this task?
I will be extremely grateful for comments. Thanks a ton. Regards,Pankaj
    [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions
should go.



  
	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list