select
Description
subvbt = select(
returns a selection of VaR backtesting data. For example, vbt
,Name=Value
)subvbt =
select(vbt,TimeRange=timeRange)
selects the portfolio and VaR data for a
specified time range.
Examples
Select VaR Backtesting Data
Use the select
function and specify the optional arguments TimeRange
and NewPortfolioID
to create a varbacktest
subobject containing data for Q1 of year 2000. Reset the portfolio ID to reflect your selection.
load VaRBacktestData vbt = varbacktest(EquityIndex,Normal95,'Time',Date); timeRange = [datetime(2000,1,1),datetime(2000,3,31)]; subvbt = select(vbt,TimeRange=timeRange,NewPortfolioID="Equity, Q1 2000")
subvbt = varbacktest with properties: PortfolioData: [65x1 double] VaRData: [65x1 double] Time: [65x1 datetime] PortfolioID: "Equity, Q1 2000" VaRID: "VaR" VaRLevel: 0.9500
Input Arguments
vbt
— varbacktest
object
varbacktest
object
VaR backtest object, specified as a varbacktest
object. vbt
contains a copy of the given data
(the PortfolioData
and VarData
properties) and all
combinations of portfolio ID, VaR ID, and VaR levels to be tested.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: subvbt = select(vbt,TimeRange=[1,100])
TimeRange
— Time range
row vector | datetime row vector | duration row vector | logical row vector
Time range for the VaR backtesting data you would like to select, specified as either of the following:
Numeric row vector, datetime row vector, or duration row vector with the data type matching the data type of the
Time
property vector of invarbacktest
object.Logical row vector with the size matching the size of the
Time
property vector in thevarbacktest
object.
The output for the varbacktest
object contains data points
corresponding to the time window TimeRange(1)
through
TimeRange(2)
or to the time points specified by a logical row
vector. If you do not specify TimeRange
, the
select
function includes all time points in the output
window.
Example: subvbt = select(vbt,TimeRange=[1,100])
Example: subvbt =
select(vbt,TimeRange=[datetime(2000,1,1),datetime(2000,3,31)])
Data Types: double
| datetime
| duration
| logical
VaRID
— VaR IDs
string vector
VaR IDs from the input varbacktest
object, specified as a
string vector. The output for the varbacktest
object contains the
selected VaR data.
Example: subvbt =
select(vbt,VaRID=["Historical95","Historical99"])
Data Types: string
NewPortfolioID
— New portfolio ID
string scalar
New portfolio ID in the output for the varbacktest
object,
specified as a string scalar.
Example: subvbt = select(vbt,TimeRange=timeRange,NewPortfolioID="Equity Q1
2000")
Data Types: string
Version History
Introduced in R2023b
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)