Description Usage Arguments Value Author(s) References Examples

Function returns Realized semivariance, defined in Barndorff-Nielsen et al. (2008).

Function returns two outcomes: 1.Downside realized semivariance and 2.Upside realized semivariance.

Assume there is *N* equispaced returns in period *t*. Let *r_{t,i}* be a return (with *i=1, …,N*) in period *t*.

Then, the rSV is given by

*
\mbox{rSVdownside}_{t}= ∑_{i=1}^{N} (r_{t,i})^2 \ \times \ I [ r_{t,i} <0 ]
*

*
\mbox{rSVupside}_{t}= ∑_{i=1}^{N} (r_{t,i})^2 \ \times \ I [ r_{t,i} >0 ]
*

1 |

`rdata` |
a zoo/xts object containing all returns in period t for one asset. |

`align.by` |
a string, align the tick data to "seconds"|"minutes"|"hours" |

`align.period` |
an integer, align the tick data to this many [seconds|minutes|hours]. |

`makeReturns` |
boolean, should be TRUE when rdata contains prices instead of returns. FALSE by default. |

`...` |
additional arguments. |

list

Giang Nguyen, Jonathan Cornelissen and Kris Boudt

Barndorff- Nielsen, O.E., Kinnebrock, S. and Shephard N. (2008). Measuring downside risk- realized semivariance. CREATES research paper. p. 3-5

1 2 | ```
data(sample_tdata)
rSV(sample_tdata$PRICE,align.by ="minutes", align.period =5, makeReturns = TRUE)
``` |

```
Loading required package: xts
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
$rSVdownside
[1] 0.0002912575
$rSVupside
[1] 0.0001631098
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.