Learn R Programming

stochvol (version 1.3.3)

logret: Computes (de-meaned) log returns.

Description

Small utlity function returning either diff(log(x)) in case the argument demean is set to FALSE, or diff(log(x)) - mean(diff(log(x))) in case that demean is TRUE.

Usage

logret(x, demean = FALSE)

Arguments

x

Real-valued vector.

demean

A single logical value indicating whether the returns should be de-meaned. Defaults to FALSE.

Value

A vector of length length(x) - 1, containing (de-meaned) returns.