[R] Converting 2D matrix to 3D array

2013-03-25 Thread Robert A';gata
Hi, I would like to create M paths of 2 correlated brownian motion incrementals where each path is of length N. I use mvrnorm to create all the increments, i.e. h <- 1.0; COV <- matrix(c(1,0,0,1),nrow=2); dW<- h * t(mvrnorm(n=N*M,mu=c(0,0),Sigma=COV)); The next step is that I'd like

[R] Package for multi-dimensional terminal value ODE solver

2013-01-27 Thread Robert A';gata
Hi, I did some googling. I found multiple ODE solver packages. But I am wondering if there is any terminal value ODE solver (linear case) for multi-dimension case or not? I have not come across any. Any guidance would be appreciated. Robert [[alternative HTML version deleted]] _

[R] Problem when plotting

2012-12-15 Thread Robert A';gata
Hi, I was trying to call chart.Posn. I ran into an unusual problem. It complains that: Error in strheight(axt): X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*..., face 1 at size 11 could not be loaded. I am wondering how to fix this? It seems something is missing from X11 device but I don't k

Re: [R] Finding percentile of a value from an empirical distribution

2012-01-10 Thread Robert A';gata
0.716 > > See ?ecdf for more information. > > HTH, > Jorge.- > > > On Tue, Jan 10, 2012 at 11:52 PM, Robert A'gata <> wrote: >> >> Hello, >> >> I am not sure how to do this in R. Any suggestion would be >> appreciated. I have a vector of

[R] Finding percentile of a value from an empirical distribution

2012-01-10 Thread Robert A';gata
Hello, I am not sure how to do this in R. Any suggestion would be appreciated. I have a vector of values from where I build an empirical CDF. For example: > x <- seq(1,100) > x <- sample(x,1000,replace=T) > quantile(x,probs=seq(0,1,.05)) 0% 5%10%15%20%25%30%35%

[R] Product integral in R

2011-12-18 Thread Robert A';gata
Hi, I am wondering if anybody ever come across any implementation of product integral in R? As far as I googled, I haven't come across any package. Is there any? Thank you. http://en.wikipedia.org/wiki/Product_integral Regards, Robert __ R-help@r-pro

[R] Double integration using R

2011-11-06 Thread Robert A';gata
Hi, I have a function that I need to do double integration: \int^T_0 \int^t_0 N(\delta / \sigma \sqrt(u)) (1-N(\delta / \sigma \sqrt(u))) du dt where N(x) is a standard normal probability of x. I start off by writing an inner integral into a function. Meaning \int^t_0 N(\delta,\sigma \sqrt(u))

Re: [R] [R-SIG-Finance] AsOf join in R

2011-10-05 Thread Robert A';gata
eferred to in this communication. Commonwealth Bank and its subsidiaries > have effected or may effect transactions for their own account in any > investments or related investments referred to herein. In the case of certain > securities Commonwealth Bank is or may be the only m

Re: [R] [R-SIG-Finance] AsOf join in R

2011-10-05 Thread Robert A';gata
referred to herein. In the case of certain > securities Commonwealth Bank is or may be the only market maker. > > -Original Message- > From: r-sig-finance-boun...@r-project.org > [mailto:r-sig-finance-boun...@r-project.org] On Behalf Of Robert A'gata > Sent: Wedn

[R] AsOf join in R

2011-10-04 Thread Robert A';gata
Hi, I tried to google for any solution for asof join operator in R. But I couldn't find one. The asof join operator AsOf(A,B) merges 2 time series by looking for latest available value of B prior to each time point in A. For example, A <- xts(c(10,15,20,25), order.by=as.POSIXct(c("2011-09-01","20

Re: [R] [R-SIG-Finance] Measure quality of fit for MA(q), ARMA(p, q) and GARCH(p, q)

2011-06-04 Thread Robert A';gata
d residuals -- see > http://www.burns-stat.com/pages/Working/ljungbox.pdf > > However, this is an in-sample test.  Much > better is to do out-of-sample tests. > > On 04/06/2011 04:46, Robert A'gata wrote: >> >> Hi, >> >> I would like to ask for a gu

[R] timezone specification on windows machine

2011-05-14 Thread Robert A';gata
Hi, I'm wondering what's the right value for specifying "America/New_York" time zone on a windows machine? I got my code which specify this time zone on as.POSIXct function work properly with this value on a linux machine. But it keeps giving me complaint on windows. Thank you. Cheers, Robert _

[R] Filtering out bad data points

2011-05-09 Thread Robert A';gata
Hi, I always have a question about how to do this best in R. I have a data frame and a set of criteria to filter points out. My procedure is to always locate indices of those points, check if index vector length is greater than 0 or not and then remove them. Meaning dftest <- data.frame(x=rnorm(1

[R] Handling of irregular time series in lineChart

2011-04-28 Thread Robert A';gata
Hi, I realized that when I have irregular series to feed into lineChart, the interval of each point in the chart does not seem to take care of irregular time interval I specified in my input xts time series. But rather, lineChart seems to take each point as equal spaced time series. For example, I

[R] loess function takes long to estimate

2011-03-04 Thread Robert A';gata
Hi, I have 2 questions regarding using loess function in stats package. 1. I have about 1 million points. I did loess with alpha=0.5 and degree=1 and 2 regressors. It has run for more than 5 hrs on 64bit 16CPU and 64GB server (with no other process running). I am wondering if this is usual? And i

[R] Plotting a 3D histogram

2011-03-01 Thread Robert A';gata
Hi - I am wondering if there is any package that does plotting of joint histogram between 2 variables, i.e. f(x,y). I found rgl but it seems not so intuitive to use. I'm wondering if there is any alternative. Thank you. Robert __ R-help@r-project.org ma