Re: [R] R function for estimating historical-VaR

2013-03-05 Thread Joshua Ulrich
Cross-posted, verbatim, on stackoverflow: http://stackoverflow.com/q/15203347/271616 -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with R | www.RinFinance.com On Mon, Mar 4, 2013 at 7:07 AM, Аскар Нысанов wrote: > > > Hi everyo

Re: [R] R function for estimating historical-VaR

2013-03-05 Thread Patrick Burns
unlist(lapply(1:n, function(i) {-sort(returns[i:(N+i)])[op]*value})) } Nello Blaser -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ? ??? Sent: Montag, 4. März 2013 14:07 To: R-help@r-project.org Subject: [R] R function fo

Re: [R] R function for estimating historical-VaR

2013-03-04 Thread Blaser Nello
tion(i) {-sort(returns[i:(N+i)])[op]*value})) } Nello Blaser -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ? ??? Sent: Montag, 4. März 2013 14:07 To: R-help@r-project.org Subject: [R] R function for estimating historical-VaR

[R] R function for estimating historical-VaR

2013-03-04 Thread Аскар Нысанов
Hi everyone!! I am new in R and I want to create a simple R function for estimating historical-VaR. In y_IBM returns, there are 2300 observations. For evaluation I take the next 2000 observations, then I abandon the latest 300 observations. Firstly, I use the window which has the fix length a