[R] Quantitative Risk Management by McNeil
spencerg
spencer.graves at prodsyse.com
Tue Jul 7 20:56:09 CEST 2009
Dear Andriy:
1. The help file for "fit.NH" says the first argument should be
a "vector of data". Consider the following modification of the example
on that help page:
> rs <- matrix(rseries, 10, 202, dimnames=list(letters[1:10], 1:202))
> rs. <- fit.NH(rs)
Error: cannot allocate vector of size 238 Kb
In addition: Warning messages:
1: In sqrt(3/(variance * ekurt)) : NaNs produced
2: In optim(par = theta, fn = negloglik, gr = NULL, datavector = data, :
Reached total allocation of 3583Mb: see help(memory.size)
3: In optim(par = theta, fn = negloglik, gr = NULL, datavector = data, :
Reached total allocation of 3583Mb: see help(memory.size)
2. This suggests you try the following:
fit.NH(as.numeric(Transpose), case="NIG", symmetric=FALSE, se=FALSE)
3. If this doesn't work, I suggest you look at "str(Transpose)":
Is this "character"?
4. If this does not solve your problem, have you tried emailing
directly Scott Ulman <scottulman at hotmail.com> for Alexander McNeil?
5. You could make it easier for others to reply to a question
like this by helping your readers find the "fit.NH" function. I have
not seen "Quantitative Risk Management by McNeil", but it sounded
interesting, so I looked at your question. I found "fit.NH" as follows:
library(RSiteSearch)
fitNH <- RSiteSearch.function('fit.NH')
HTML(fitNH)
This last line opened a web browser with links to 6 different help
pages in the "QRMlib" package.
Hope this helps.
Spencer Graves
Andriy Fetsun wrote:
> Dear Specialists in R,
>
> May be somebody has experiment in using pakage for the book Quantitative
> Risk Management by McNeil?
>
> This package is writen in R.
>
> I have run this package for fitting the data to Nornal Inverse Gaussian
> distribution and fased with following problem.
>
>
>> Return<-read.csv("data.csv")
>> Transpose<-t(Return)
>> fit.NH(Transpose, case="NIG", symmetric=FALSE, se=FALSE)
>>
> Error: cannot allocate vector of size 57 Kb
> In addition: Warning messages:
> 1: In var.default(data) :
> Reached total allocation of 222Mb: see help(memory.size)
> 2: In optim(par = theta, fn = negloglik, gr = NULL, datavector = data, :
> Reached total allocation of 222Mb: see help(memory.size)
> 3: In optim(par = theta, fn = negloglik, gr = NULL, datavector = data, :
> Reached total allocation of 222Mb: see help(memory.size)
>
> In the attachment you can find the description of the function.
>
> the link where I took this soft is
> http://cran.r-project.org/web/packages/QRMlib/index.html
>
> Thank you in advance!
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list