Create a net-asset-value (NAV) series.
NAVseries(NAV, timestamp,
instrument = NULL, title = NULL,
description = NULL,
drop.NA = NULL)as.NAVseries(x, ...)
# S3 method for NAVseries
print(x, ... , na.rm = FALSE)
# S3 method for NAVseries
summary(object, ..., monthly.vol = TRUE,
bm = NULL, monthly.te = TRUE,
na.rm = FALSE, assume.daily = FALSE)
# S3 method for NAVseries
plot(x, y, ..., xlab = "", ylab = "", type = "l")
# S3 method for NAVseries
window(x, start = NULL, end = NULL, ...)
an NAVseries
: see Details.
an NAVseries
summary: a list of lists. If a
benchmark series is present, the summary has an
attribute bm
: an integer, specifying the
position of the benchmark.
numeric
character
character
character
an NAVseries
or an object to be coerced to NAVseries
an NAVseries
further arguments. For summary
, these can be
NAVseries
.
logical. If NAV
is the result of calling
btest
, then this controls whether unused initial
observations (‘burnin’) are dropped.
an optional NAVseries. If bm
does not inherit
from NAVseries
, as.NAVseries
is
tried.
if TRUE
(default), volatility computations
are done on monthly returns
if TRUE
(default), tracking-error computations
are done on monthly returns
logical
logical
a second NAVseries to be plotted. Not supported yet.
character. See plot
.
character. See plot
.
character. See plot
.
same class as timestamp; NULL
means the first timestamp
same class as timestamp; NULL
means the last timestamp
Enrico Schumann <es@enricoschumann.net>
An NAV series is a numeric vector (the actual series) and
additional information, attached as attributes: timestamp,
instrument, title, description. Of these attributes,
timestamp is the most useful, as it is used for several
computations (e.g. when calling summary
) or
for plotting.
The ‘instrument’ is typically an internal label used to identify the series, such as a ticker; ‘title’ is a label, too, but is intended to be human-readable; ‘description’ finally should be human-readable as well, but may be longer than ‘title’.
The summary
method returns a list of the original
NAVseries plus various statistics, such as return per year
and volatility. The method may receive several NAV series
as input.
Schumann, E. (2024) Portfolio Management with R.
https://enricoschumann.net/PMwR/; in particular, see
https://enricoschumann.net/R/packages/PMwR/manual/PMwR.html#NAVseries
btest
, journal
For handling external cashflows, see unit_prices
,
split_adjust
and div_adjust
.
summary(NAVseries(DAX[[1]], as.Date(row.names(DAX)), title = "DAX"))
Run the code above in your browser using DataLab