Description Usage Arguments Value Author(s) See Also Examples
View source: R/other_functions.r
This function helps to create a new entity of a crp.CSFP object. The arguments, given to the functions become the attributes of the new model.
1 2 3 4 5 6 7 8 | init(path.in = "", path.out = "", port.name = "portfolio.csv",
rating.scale.name = "rating_pd.csv", sec.var.name = "pd_sector_var.csv",
sec.var.est = 5, loss.unit = 1e+06, Niter.max = 0, alpha.max = 0.9999,
Niter.max.global = 1e+05, alpha = c(0.999), PLOT.PDF = TRUE,
export.to.file = FALSE, calc.rc = FALSE, PLOT.scale = 1e+06,
PLOT.range.x = c(0, 0), PLOT.range.y = c(0, 0), save.memory = FALSE,
file.format = "csv", portfolio = data.frame(), rating.scale = data.frame(),
sec.var = data.frame())
|
portfolio |
is a data frame containing the portfolio information. The structure has to be the same as described in |
rating.scale |
is a data frame containing the rating master scale. The structure has to be the same as described in |
sec.var |
is a data frame containing the sector variances. The structure has to be the same as described in |
path.in |
is a character string with the path to the directory, where are the input files. All input files have to be in this directory. It must end with "...\\" or ".../".
In alternative the files can be passed as data frames to |
file.format |
is a character string defining the format of the input files. You can choose between 'csv', which means that the separation character is ',' and the decimal character is '.' and 'csv2', which means that the separation character is ';' and the decimal character is ','. |
path.out |
is a character string with the path to the directory, where the output should be written to if |
port.name |
is a character string with the name of the portfolio file, ending with ".csv". The file must contain the following columns: CPnumber, CPname, exposure,lgd, maturity, rating, S1, S2 ,... . Take care of the right spelling of the column titles and capitalization. |
rating.scale.name |
is a character string with the name of the rating file, ending with ".csv". The file must contain the following columns: RATING, PD, SD. The SD column is not necessary if |
sec.var.name |
is a character string with the name of the file containing the sector variances, ending with ".csv". The file must contain the column Var. Take care of the right spelling and capitalization. The file is not used if |
sec.var.est |
is an indicator for the mode, the sector standard deviations should be calculated. |
loss.unit |
is the discretization parameter for net exposures. |
Niter.max |
is the maximum number of exposure bands/probabilities being calculated. |
alpha.max |
in alternative to |
Niter.max.global |
is the maximum number of iterations if |
alpha |
is the vector of confidence levels (between 0 and 1), the Value at risk and expected shortfall should be calculated. It should be no problem if the entries are not in an ascending order. For the risk contributions only the last entry will be considered. |
PLOT.PDF |
is a logical indicator for plotting the PDF or not. It will not be recognized if you start |
export.to.file |
is a logical indicator defining if loss distribution, risk contributions and a summary should be exported to |
calc.rc |
is a flag for calculating the risk contributions or not. It will not be recognized if you start |
PLOT.scale |
is a numeric value defining the scale for the horizontal axis (the losses) of the plot of the PDF. |
PLOT.range.x |
is a numeric vector with two entries representing the range on the x-axis (the losses) for the plot of the loss distribution. If you insert values smaller one, this will be interpreted as levels of the CDF. The defaults for |
PLOT.range.y |
is the same as |
save.memory |
is a switch for the save memory mode. If |
A new object of class crp.CSFP.
Kevin Jakob & Dr. Matthias Fischer
1 2 3 4 5 6 7 8 9 10 11 | MyModel=init(path.in=system.file("data",package="crp.CSFP"),loss.unit=1e6,
calc.rc=TRUE)
# or pass portfolio directly and use random sector variances
Path=system.file("data",package="crp.CSFP")
portfolio=read.csv(paste(Path,"/portfolio.csv",sep=""))
rating.scale=read.csv(paste(Path,"/rating_pd.csv",sep=""))
sec.var=data.frame(Var=runif(3,0,2))
MyModel=init(portfolio=portfolio,rating.scale=rating.scale,sec.var=sec.var,
loss.unit=1e6,calc.rc=TRUE)
|
CreditRisk+ portfolio model
Copyright (C) 2011 Dr. Matthias Fischer, Kevin Jakob & Stefan Kolb
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Please note that this package will not be updated anymore.
Instead we recommend to use the GCPM package which includes
the functionality of this package as well as more flexible
and more powerfull extensions.
CreditRisk+ portfolio model
Copyright (C) 2011 Dr. Matthias Fischer, Kevin Jakob & Stefan Kolb
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Please note that this package will not be updated anymore.
Instead we recommend to use the GCPM package which includes
the functionality of this package as well as more flexible
and more powerfull extensions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.