Search code examples
rxtsnazooquantitative-finance

Calculating/subsetting returns from a data frame (XTS/ZOO) of security prices with NA values?


I have a data frame of size 1379 x 843 such that the rows are the daily prices, and the columns are the securities.

I want to calculate returns and subset these returns based on a drop in 30% in a day, but I am having trouble dealing with the large number of NA values.

How do most of you go about dealing with NA values, especially given the case which I have described?


Solution

  • Never mind, I figured it out. Just using the functions contained in performance analytics worked. I didn't check the output carefully enough.