I have multivariate time series data and I am using xts but am open to alternatives. I am trying to write a function for a user.

 

For all years combined, I would like to find quarterly volatility (sd). I want to have just four outputs: Q1, Q2, Q3, Q4. 

 

Can someone help me out?

 

If instead I wanted to find the volatility for each quarter of each year, I would use something like:

 

apply.quarterly(xInput, function(x) apply(x,2,sd))

 

This would give me results for 2008Q1, 2008Q2, ., 2009Q1, ., 2011Q2

	[[alternative HTML version deleted]]

