(x)
return torch.exp(x) - 1
Turn simple returns into log returns.

    r_simple = exp(r_log) - 1.

    Parameters
    ----------
    x : torch.Tensor
        Tensor of any shape where each entry represents a simple return.

    Returns
    -------
    torch.Tensor
        Logarithmic returns.
Turn simple returns into log returns.
Turn simple returns into log returns .
def log2simple(x):
    """Turn simple returns into log returns.

    r_simple = exp(r_log) - 1.

    Parameters
    ----------
    x : torch.Tensor
        Tensor of any shape where each entry represents a simple return.

    Returns
    -------
    torch.Tensor
        Logarithmic returns.

    """
    return torch.exp(x) - 1
def log2simple ( x ) : return torch . exp ( x ) - 1