Re: [R] R-help Digest, Vol 93, Issue 5

2010-11-05 Thread Joshua Ulrich
] is a time-based class (e.g. Date, POSIXt). If it is character, you will need to convert it to a time-based class before calling xts(). Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com ___ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Zoo - bug ???

2010-11-30 Thread Joshua Ulrich
,mean, na.rm=TRUE, na.pad=FALSE, align=right) cbind(A1a,A1b) A1a A1b 1 NA NA 2 NA NA 31 1.0 42 1.5 53 2.0 64 3.0 75 4.0 86 5.0 9 NA 5.5 10 NA 6.0 HTH, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com mean(c(1,NA, NA), na.rm=TRUE) [1] 1 A1a-zoo(c(NA

Re: [R] Averaging half hourly data to hourly

2010-06-28 Thread Joshua Ulrich
period.apply(x, endpoints(x,hours), mean) [,1] 1969-12-31 18:30:00 1.0 1969-12-31 19:30:00 2.5 1969-12-31 20:30:00 4.5 1969-12-31 21:30:00 6.5 1969-12-31 22:30:00 8.5 1969-12-31 23:00:00 10.0 Best, -- Joshua Ulrich FOSS Trading: www.fosstrading.com

Re: [R] AR-GARCH with additional variable - estimation problem

2011-07-13 Thread Joshua Ulrich
Please don't cross-post: https://mailman.stat.ethz.ch/pipermail/r-sig-finance/2011q3/008230.html -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Wed, Jul 13, 2011 at 11:11 AM, Marcin P?�ciennik puc...@gmail.com wrote: Dear list members, I am trying to estimate parameters of the AR

Re: [R] FOMULATING TIME SERIES DATA FROM DATA FRAME

2011-07-17 Thread Joshua Ulrich
of Economics UDSM Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] Plotting intraday data in quantmod

2011-07-18 Thread Joshua Ulrich
What's your problem? What have you tried? -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Mon, Jul 18, 2011 at 11:39 PM, kev946 klee...@gmail.com wrote: Hello, I'm new to R and am having trouble plotting intraday data on a chart. I haven't had any success with using ideas from some

Re: [R] Plotting intraday data in quantmod

2011-07-19 Thread Joshua Ulrich
command. What plot command are you using? Dates don't have H:M:S; they're all zero. You don't provide a sample of Dataset, so we don't know what your data look like. Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@r-project.org

Re: [R] Picking returns from particular days of the month from a zoo object

2011-07-23 Thread Joshua Ulrich
, John B. Nicholas, Ph.D 650-315-9895 HTH, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] Plot.xts - how to change the x-axis labels to show weekly labels.

2011-07-30 Thread Joshua Ulrich
, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Sat, Jul 30, 2011 at 9:10 AM, Eduardo M. A. M.Mendes emammen...@gmail.com wrote: Dear R-users I am new to R and struggling not to bother the list with silly questions. I read the documentation on xts and searched for some

Re: [R] possible problem with endpoints?

2011-03-17 Thread Joshua Ulrich
__ R-help@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. -- Joshua Ulrich | FOSS

Re: [R] Need to abstract changing name of column within loop

2011-03-17 Thread Joshua Ulrich
, self-contained, reproducible code. -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] quantmod Some Single Letter Tickers Not getFin

2011-03-19 Thread Joshua Ulrich
http://www.google.com/finance?fstype=iiq=F results in a 400 'Bad request' error. This seems to work for this one symbol, maybe it will work for others as well. getFin(NYSE:F) Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Thu, Mar 17, 2011 at 10:48 PM, Sparks, John James jspa

Re: [R] Package Installation

2011-03-21 Thread Joshua Ulrich
-contained, reproducible code. -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] multiple plots with QQplot of PerformanceAnalytics

2011-03-25 Thread Joshua Ulrich
Please don't cross-post. -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Fri, Mar 25, 2011 at 8:33 AM, William Mok wwl_...@yahoo.co.uk wrote: Hi All, I am trying to plot 4 graphs on to 1 page using layout(...), or par(mfcol = c(...)); with the function QQplot from the package

Re: [R] How to speed up grouping time series, help please

2011-04-04 Thread Joshua Ulrich
]]) median(Time03) [1] 0.02 xtsTime - replicate(100, + system.time(do.call(merge, split(x$VALUE,x$ID)))[[1]]) median(xtsTime) [1] 0 Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] 'RQuantLib for 2.12 version

2011-04-04 Thread Joshua Ulrich
Hi Mauricio, A Windows binary is now available on CRAN: http://dirk.eddelbuettel.com/blog/2011/04/04/#rquantlib_0.3.7 Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Tue, Mar 29, 2011 at 10:38 AM, Mauricio Romero mauricio.rom...@quantil.com.co wrote: Dear R users, I have

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Joshua Ulrich
still calls Fortran code, so that's why it's slower than caTools::runmean. I've moved the EMA code to C, so it's about as fast as it can be. Noah, use EMA's ratio argument to replicate your for loop. Hope this helps, Michael Weylandt Best, -- Joshua Ulrich | FOSS Trading

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Joshua Ulrich
, the function is in C. You could also use the compiler package to compile your pure R function for a 3-4x speedup. Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com -- Noah Silverman UCLA Department of Statistics 8117 Math Sciences Building #8208 Los Angeles, CA 90095 On Sep 2

Re: [R] Getting Rcpp SEXP data in C++

2011-09-13 Thread Joshua Ulrich
/manuals/R-ints.html cheers Worik Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] xts/time-series and plot questions...

2011-10-03 Thread Joshua Ulrich
. greatly appreciated! Thanks,  -=Doug Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] R and Forex

2011-10-12 Thread Joshua Ulrich
R-help and R-devel. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Wed, Oct 12, 2011 at 9:05 PM, R. Michael Weylandt michael.weyla...@gmail.com michael.weyla...@gmail.com wrote: To be honest, I don't frequently have occasion to wander over to R-devel and most of what goes

Re: [R] Control number of assets in resulting portfolio with optimizations using package fPortfolio

2012-02-17 Thread Joshua Ulrich
Alex, You may find an answer to your question by searching the R-SIG-Finance archives (via rseek.org). If not, you may want to consider asking your question on the R-SIG-Finance list. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R

Re: [R] Store vectors as values in xts time-series object

2012-03-04 Thread Joshua Ulrich
Hi Sergey, Internally, xts objects are a matrix with an index attribute. While you *can* make a matrix of lists, that is not supported in zoo or xts. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R www.RinFinance.com On Sun, Mar 4, 2012

Re: [R] Wrong output due to what I think might be a data type issue (zoo read in problem)

2012-03-20 Thread Joshua Ulrich
mistake related to asking questions correctly according to forum specifications. Thanks for any help! I will keep messing around with colClassesI feel like I am close to a solution..however, am very far from understanding the problem. Best, -- Joshua Ulrich | FOSS Trading

Re: [R] Weird POSIXct behaviour

2012-03-25 Thread Joshua Ulrich
equality. cheers Worik -- Joshua Ulrich | FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R www.RinFinance.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Weird POSIXct behaviour

2012-03-25 Thread Joshua Ulrich
of sessionInfo(), or packageDescription(zoo). The output from sessionInfo() would be more helpful because it provides more information about your installation. Worik -- Joshua Ulrich | FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R www.RinFinance.com

Re: [R] Weird POSIXct behaviour

2012-03-29 Thread Joshua Ulrich
On Thu, Mar 29, 2012 at 3:56 PM, Worik R wor...@gmail.com wrote: I have a reproducible example of my problem below On Mon, Mar 26, 2012 at 9:22 AM, Joshua Ulrich josh.m.ulr...@gmail.com wrote: Given two identical string representations of POSIXct objects, can the two objects represent

Re: [R] newbie question: strategy

2012-04-07 Thread Joshua Ulrich
consulting rate. Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R www.RinFinance.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Downloading quote data from yahoo finance

2010-12-04 Thread Joshua Ulrich
) viewFinancials(IBM.f) Thank you very much for the time you have given. Regards, Deb Hope that helps, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] as.xts error

2010-12-06 Thread Joshua Ulrich
. You have a couple options: a - data.frame(Date=Sys.Date()+1:10, bid_hsi=trunc(21800+runif(10)*100)) # 1) rownames(a) - a$Date p - as.xts(a[,bid_hsi,drop=FALSE]) # 2) p - as.xts(a[,bid_hsi,drop=FALSE], order.by=a$Date) Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com Try this (you

Re: [R] XTS : merge.xts seems to have problem with character vectors

2011-01-04 Thread Joshua Ulrich
. -- Joshua Ulrich | FOSS Trading: www.fosstrading.com Cheers, Chris -- View this message in context: http://r.789695.n4.nabble.com/XTS-merge-xts-seems-to-have-problem-with-character-vectors-tp3174125p3174125.html Sent from the R help mailing list archive at Nabble.com

Re: [R] Interpolate xts

2011-01-11 Thread Joshua Ulrich
Use na.approx: set.seed(21) x - xts(rnorm(10), Sys.time()-10:1) is.na(x) - 2:4 is.na(x) - 8:9 na.approx(x) na.spline(x) Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Tue, Jan 11, 2011 at 12:08 AM, Rustamali Manesiya rmanes...@gmail.com wrote: Hello,       I have a xts

Re: [R] Aggragating subsets of data in larger vector with sapply

2011-01-11 Thread Joshua Ulrich
Hi Chris, This seems to work on the sample data you provided. FUN - function(x) { x - xts(as.numeric(x),index(x)) period.apply(x, endpoints(x,secs), sum) } lapply(split.default(xSym$Size,xSym$Direction), FUN) Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Sun, Jan 9

Re: [R] to append a column to a data frame, has I use loop/if in my case?

2011-01-18 Thread Joshua Ulrich
Please do not cross post: http://stackoverflow.com/q/4720076/271616 At the minimum, it would be polite to respond here with the answer you accepted on Stack Overflow. -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Mon, Jan 17, 2011 at 8:59 AM, Daniel Wu daniel_w...@163.com wrote

Re: [R] Plotting multiple xts/zoo time series on a single plot.

2011-01-22 Thread Joshua Ulrich
See ?plot.zoo, specifically plot.type=single. -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Sat, Jan 22, 2011 at 8:02 PM, Nick Torenvliet nick.torenvl...@gmail.com wrote: So I've got a 154 column wide xts time series object and I want to plot the 154 series on a single plot

Re: [R] cbind giving NA's?

2011-10-24 Thread Joshua Ulrich
-02 7.6343 NA 2010-04-03 7.5458 NA 2010-04-04 7.4532 28.30 2010-04-05 7.4040 28.38 2010-04-06 7.3317 28.21 2010-04-07 NA 28.31 2010-04-08 NA 28.47 Jeff's answer on StackOverflow explains why this works. Best, -- Joshua Ulrich  |  FOSS Trading

Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread Joshua Ulrich
Deb, See getQuote in the quantmod package. For example: getQuote(SPY) Be sure to read ?getQuote. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Thu, Nov 3, 2011 at 5:05 PM, Deb Midya debmi...@yahoo.com wrote: Michael, Thanks for your response. The link to the page

Re: [R] Extract Data from Yahoo Finance

2011-11-04 Thread Joshua Ulrich
Deb, Sorry, you can't do that with getQuote because Yahoo does not make those data available historically. Generally, you will need to pay for historical bid/ask (tick) data. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Fri, Nov 4, 2011 at 6:10 AM, Deb Midya debmi

Re: [R] R problem: unable to read data in the xls-format in the PerformAnalytics package

2012-01-11 Thread Joshua Ulrich
to generate a date format for monthly data which can be read unter PerformanceAnalytics. I attach my csv data. Thanks for your help! yvonne Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@r-project.org mailing list https

Re: [R] plotOHLC(alpha3): Error in plotOHLC(alpha3) : x is not a open/high/low/close time series

2012-01-11 Thread Joshua Ulrich
/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. -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@r-project.org

Re: [R] plotOHLC(alpha3): Error in plotOHLC(alpha3) : x is not a open/high/low/close time series

2012-01-11 Thread Joshua Ulrich
, Ted Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] the significance of BEKK estimation

2012-01-25 Thread Joshua Ulrich
. It will probably work if you build from source, which is also provided on the site. Greetings. Carlos Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com -- View this message in context: http://r.789695.n4.nabble.com/the-significance-of-BEKK-estimation-tp3716586p4328039.html

Re: [R] wilderSum

2012-02-08 Thread Joshua Ulrich
, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Wed, Feb 8, 2012 at 3:50 AM, yuanwei zhuyuanw...@gmail.com wrote: Hi  Joshua,    Before I found your post here, I have viewed your source code for 'wilderSum'http://cran.r-project.org/src/contrib/TTR_0.21-0.tar.gz to figure out how

Re: [R] Another quantmod question

2011-05-08 Thread Joshua Ulrich
to do the legwork. -- Russ -- Joshua Ulrich | FOSS Trading: www.fosstrading.com On Sun, May 8, 2011 at 2:42 PM, Jeff Ryan jeff.a.r...@gmail.com wrote: Hi Russ, Colnames don't get rewritten if they already exist. The reason is due to performance and how cbind is written at the R

Re: [R] More effective calculation for loop

2011-05-13 Thread Joshua Ulrich
code. -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] RES: time series interpolation

2011-06-30 Thread Joshua Ulrich
=seq(start(w03_11temp_z), end(w03_11temp_z), by=1))) w03_11temp_x - na.approx(w03_11temp_y) w03_11temp_w - data.frame(date=format(index(w03_11temp_x), %d.%m.%y),                   time=format(index(w03_11temp_x), %H:%M:%S), temp=coredata(w03_11temp_x)) -- Joshua Ulrich | FOSS Trading

Re: [R] Inserting rows of interpolated data

2013-02-12 Thread Joshua Ulrich
# object that has all the index values you want Z - merge(z, zoo(,seq(start(z),end(z),by=1 min))) # interpolate between the 5-min observatoins Z - na.approx(Z) HTH, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with R

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, Аскар Нысанов nysanas...@mail.ru

Re: [R] Converting to XTS loses data.frame structure

2012-05-29 Thread Joshua Ulrich
, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] Gaps on merging xts objects

2012-06-11 Thread Joshua Ulrich
Eric, I'd be happy to help. Please follow the posting guide (specifically the Surprising behavior and bugs section) and provide a *minimal*, reproducible example and the output from sessionInfo(). http://www.r-project.org/posting-guide.html Best, -- Joshua Ulrich  |  FOSS Trading

Re: [R] what does .indexDate() do - R::xts

2012-06-12 Thread Joshua Ulrich
it's not well documented, what it's doing is pretty clear from the source: R .indexDate function (x) { .index(x)%/%86400L } environment: namespace:xts thanks and best regards matt johnson Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com

Re: [R] DEoptim example illustrating use of fnMap parameter for enforcement of cardinality constraints

2012-06-15 Thread Joshua Ulrich
, fnMap=mappingFun) Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Fri, Jun 15, 2012 at 3:24 AM, David-Michael Lincke dlin...@lincke.com wrote: Function DEoptim in package DEoptim for differential evolution defines an optional parameter fnMap: fnMap an optional function

Re: [R] DEoptim example illustrating use of fnMap parameter for enforcement of cardinality constraints

2012-06-16 Thread Joshua Ulrich
in the vignette. Best regards, David Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com -Original Message- From: Joshua Ulrich [mailto:josh.m.ulr...@gmail.com] Sent: Saturday, June 16, 2012 3:29 AM To: David-Michael Lincke Cc: r-help@r-project.org Subject: Re: [R] DEoptim example

Re: [R] Profit calculation

2012-06-19 Thread Joshua Ulrich
On Tue, Jun 19, 2012 at 6:07 PM, Bert Gunter gunter.ber...@gene.com wrote: 1. Don't double post. (obviously belongs on finance list) 2. Homework? (we don't do homework on r-help) We don't do homework on R-SIG-Finance either... -- Bert Best, -- Joshua Ulrich | FOSS Trading

Re: [R] Getting objects from quantmod ticker list

2012-07-07 Thread Joshua Ulrich
Load the data into an environment, then merge them using do.call(): series.env - new.env() getSymbols(ticker.list, src='FRED', env=series.env) series - do.call(merge, as.list(series.env)) HTH, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com On Sat, Jul 7, 2012 at 7:00 AM, Cren

Re: [R] calculate within-day correlations

2012-09-15 Thread Joshua Ulrich
%M%S x - xts(Q_hourly[Q], as.POSIXct(Q_hourly$datetime.str, format=fmt)) Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com -- View this message in context: http://r.789695.n4.nabble.com/calculate-within-day-correlations-tp4643091p4643206.html Sent from

Re: [R] Start and End day of a month

2012-09-27 Thread Joshua Ulrich
(c,lapply(Dt, lastof, 23, 59, 59))) -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com - Original Message - From: R. Michael Weylandt michael.weyla...@gmail.com To: Rantony antony.akk...@ge.com Cc: r-help@r-project.org Sent: Thursday, September 27, 2012

Re: [R] Date Math

2012-10-15 Thread Joshua Ulrich
can't iterate over dates/times anyway, just iterate over the xts index and what you want to do is trivial (as you said). -- Noah Silverman, M.S. UCLA Department of Statistics 8117 Math Sciences Building Los Angeles, CA 90095 Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading

Re: [R] XTS Subsetting question (noob)

2012-10-16 Thread Joshua Ulrich
guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com __ R-help@r-project.org mailing list https

Re: [R] as.xts

2012-10-17 Thread Joshua Ulrich
or factor). Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Wed, Oct 17, 2012 at 2:15 PM, sf631 chad.g...@gmail.com wrote: I'm not the original poster, but I do have the same question. I have pulled in data via RODBC into a data frame, which looks like below

Re: [R] rollapply() by time, not entries (width)

2012-10-27 Thread Joshua Ulrich
intervals. I'd suggest using a for loop with the window() function. But be careful about timezone and DST issues if your data is more frequent than daily. Cheers, Michael Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Fri, Oct 26, 2012 at 7:33 PM

Re: [R] Problems plotting a sparse time series in R

2012-10-29 Thread Joshua Ulrich
-help@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. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading

Re: [R] how to get growth rate of a (time series) data?

2013-06-19 Thread Joshua Ulrich
, not discrete, compounding by default. So you need: ROC(test$Y, n=1, type=discrete) Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] error in VaR calculation

2013-06-25 Thread Joshua Ulrich
r != R (you mis-typed the first argument to VaR). This works: library(PerformanceAnalytics) data(sample_matrix) x - Return.calculate(as.xts(sample_matrix)) VaR(R=x, p=0.99, method=historical) Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Tue, Jun 25

Re: [R] help

2013-07-16 Thread Joshua Ulrich
someone help me using this data or help me to download different data? Use quantmod::getSymbols. library(quantmod) getSymbols(MCD) str(MCD) And read ?xts for ways to subset the MCD object. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com

Re: [R] Switching log(J) to log(J+1) to avoid log(0) in HAR-RVJ model

2012-07-19 Thread Joshua Ulrich
Cross-posted on Stack Overflow: http://stackoverflow.com/q/11567745/271616 -- Joshua Ulrich | FOSS Trading: www.fosstrading.com On Thu, Jul 19, 2012 at 12:23 PM, cursethiscure caolan.harv...@mail.dcu.ie wrote: I am working with xts dependent data, and my code is as follows (the problem

Re: [R] Change log(J) to log(J+1) to stop log(0) from occurring in harModel

2012-07-19 Thread Joshua Ulrich
Same post on Stack Overflow (again): http://stackoverflow.com/q/11567745/271616 -- Joshua Ulrich | FOSS Trading: www.fosstrading.com On Thu, Jul 19, 2012 at 11:15 AM, cursethiscure caolan.harv...@mail.dcu.ie wrote: I think the code is part of the RTAQ package but is not included in it, as I

Re: [R] timeBasedSeq stumbles over the year 2038 (xts package)

2012-08-01 Thread Joshua Ulrich
/datetime.c, for anyone interested in digging further. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Wed, Aug 1, 2012 at 6:10 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: http://en.wikipedia.org/wiki/Year_2038_problem Workaround 1: Avoid collecting data

Re: [R] calculate within-day correlations

2012-09-13 Thread Joshua Ulrich
commented, minimal, self-contained, reproducible code. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] ts instead of xts object

2014-03-11 Thread Joshua Ulrich
, as is generally the case, use the as method: as.ts(testTSRad) Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] ts instead of xts object

2014-03-16 Thread Joshua Ulrich
: Hello, On Tue, Mar 11, 2014 at 8:45 PM, Joshua Ulrich josh.m.ulr...@gmail.com wrote: On Tue, Mar 11, 2014 at 12:14 AM, Bill william...@gmail.com wrote: Hello. I have a dataframe that has a date column. The intervals between dates vary. I want to convert this to a ts object. I was able

Re: [R] help with xts

2014-05-18 Thread Joshua Ulrich
, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Sun, May 18, 2014 at 9:25 AM, Pete freeri...@gmail.com wrote: I have 3 xts objects: test, cond1, cond2 You can download here: https://dl.dropboxusercontent.com/u/102669/obj.rar My problem is very simple

Re: [R] Collapsing data.frame to its or xts

2014-06-05 Thread Joshua Ulrich
in the footer. Here are some suggestions of how to create a *minimal*, reproducible example: http://stackoverflow.com/q/5963269/271616 Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com __ R-help@r-project.org mailing list

Re: [R] cross-sectional analysis of a financial time series

2013-08-22 Thread Joshua Ulrich
(YHOO) YHOO$YHOO.Return - ROC(Ad(YHOO),type=discrete) f - function(x,n) { coredata(last(x,n)) } # one way x - sapply(split(YHOO$YHOO.Return, months), f, n=10) rowMeans(x) # another way ep - endpoints(YHOO,months) y - period.apply(YHOO$YHOO.Return, ep, f, n=10) colMeans(y) Best, -- Joshua Ulrich

Re: [R] missed values

2012-12-02 Thread Joshua Ulrich
, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Fri, Nov 30, 2012 at 11:28 AM, arun smartpink...@yahoo.com wrote: Hi, May be this helps: dat1-read.table(text= ---data--- ,header=TRUE,stringsAsFactors=FALSE) library(zoo) dat1$date

Re: [R] error of installing/building an R package (PortfolioAnalytics) on Win 7

2012-12-03 Thread Joshua Ulrich
+ R CMD install. I'd start with building xts from source (admittedly harder because it has c code unlike PA) but so goes dependency management. Since you're on Windows, I'd also just (re-)remind you to make sure your path has no spaces in it. Michael Best, -- Joshua Ulrich | about.me

Re: [R] How to draw frequency domain plot with xts time series data

2012-12-18 Thread Joshua Ulrich
Cross-posted on Stackoverflow: http://stackoverflow.com/q/13935782/271616 -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Tue, Dec 18, 2012 at 7:59 AM, 박상규 birdfir...@naver.com wrote: Hello, I'd like to convert the below time-series data with fft or wavelet

Re: [R] How to convert xts data into list

2012-12-19 Thread Joshua Ulrich
chron indexes aren't well-supported in xts. Convert the index class to POSIXct and it will plot. indexClass(zc) - POSIXct plot(zc) Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Wed, Dec 19, 2012 at 9:47 AM, 박상규 birdfir...@naver.com wrote: Thank

Re: [R] How to do a moving window on standard deviation

2011-01-30 Thread Joshua Ulrich
that time-series objects will generally put time periods in ascending order. library(TTR) d$st.dev - runSD(d$Close,4) z - zoo(d[,2,FALSE],as.Date(d[,1])) z$st.dev - runSD(z$Close,4) x - as.xts(z) x$st.dev - runSD(x$Close,4) HTH, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com -- View

Re: [R] SMA and EMA in package TTR

2011-02-02 Thread Joshua Ulrich
would appreciate patches. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Sat, Jan 29, 2011 at 7:39 PM, Anyi Zhu anyi@gmail.com wrote: Hi, Just wondering for the SMA and EMA in package TTR, is it possible to me to code it so that, say if I need to calculate SMA (x, n=100

[R] R Users Group in Saint Louis, MO

2011-02-27 Thread Joshua Ulrich
for data analysis, statistical modeling, visualization, and programming. Anyone with a background or interest in R is welcome! The group will use meetup.com to communicate with members. Please sign up to receive updates and RSVP to events: http://www.meetup.com/Saint-Louis-RUG/ Best, -- Joshua Ulrich

Re: [R] xts POSIXct index format

2011-03-05 Thread Joshua Ulrich
Hi Chris, Perhaps something like this? require(xts) ds - options(digits.secs=6) # so we can see sub-seconds x - xts(1:10, as.POSIXct(2011-01-21) + c(1,1,1,2:8)/1e3) x indexFormat(x) - %H:%M:%OS3 x Hope that helps, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Fri, Mar 4, 2011

Re: [R] xts POSIXct index format

2011-03-06 Thread Joshua Ulrich
Hi David, On Sat, Mar 5, 2011 at 11:00 PM, David Winsemius dwinsem...@comcast.net wrote: On Mar 5, 2011, at 11:28 AM, Joshua Ulrich wrote: Hi Chris, Perhaps something like this? require(xts) ds - options(digits.secs=6) # so we can see sub-seconds x - xts(1:10, as.POSIXct(2011-01-21) + c

Re: [R] pass character vector in instrument field of get.hist.quote function

2011-03-13 Thread Joshua Ulrich
137.2938.40 # 2011-01-06 32.04 19.79 57.49 138.0737.23 # 2011-01-07 31.95 19.77 57.20 138.3537.30 # 2011-01-10 31.55 19.76 58.22 142.6937.04 Hope that helps, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Sun

Re: [R] Zoo Data

2013-03-12 Thread Joshua Ulrich
=,, header=TRUE, FUN=as.POSIXct, format=%d.%m.%Y %H:%M:%S)) dat1[T02:30/T03:00] Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with R | www.RinFinance.com On Sat, Mar 9, 2013 at 11:59 AM, arun smartpink...@yahoo.com wrote

Re: [R] Find NA in xts object

2013-03-16 Thread Joshua Ulrich
On Sat, Mar 16, 2013 at 2:25 PM, Pete freeri...@gmail.com wrote: Hi to all, i'm new to R I have an xts object. Can i find: a) how many NA are in my object ? sum(is.na(obj)) b) eventually where (in which line) they are which(is.na(obj)) Thank you Best, -- Joshua Ulrich | about.me

Re: [R] xts object translation

2013-04-07 Thread Joshua Ulrich
) aaabbbcccddd 2001-01-03 179.7061 239.11 1712.6 271.10 2001-01-04 181.1751 243.24 1689.1 267.15 Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with R | www.RinFinance.com On Sun, Apr 7, 2013 at 8:34

Re: [R] cbind for list of zoo objects

2013-04-08 Thread Joshua Ulrich
'fill', 'suffixes', or 'drop'. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with R | www.RinFinance.com On Mon, Apr 8, 2013 at 2:54 PM, Harry Mamaysky h.mamay...@gmail.com wrote: Can someone explain why this happens when

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Joshua Ulrich
at gmail.com -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with R | www.RinFinance.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] importing and merging many time series

2013-04-15 Thread Joshua Ulrich
can always convert the final object back to zoo. Regards, Anton Lebedevich. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with R | www.RinFinance.com __ R-help@r-project.org

Re: [R] Can DEoptim trace output be customized?

2013-05-09 Thread Joshua Ulrich
Hi David, Unfortunately, there's no way for the user to do that. You would need to change line 522 in de4_0.c (where the printing occurs) and rebuild/install the package. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance

Re: [R] Math problem with xts objects

2013-05-13 Thread Joshua Ulrich
] ) But, that is horrendously slow. Suggestions? Use lag. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with R | www.RinFinance.com __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Divide tick-data into intervalls

2012-05-08 Thread Joshua Ulrich
(x) Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com R/Finance 2012: Applied Finance with R www.RinFinance.com On Tue, May 8, 2012 at 3:14 AM, oswi3605 je...@mailinator.com wrote: Hello, Im currently writing my bachelor thesis in statistical finance and i have run into a small

Re: [R] Quantmod, Xts, TTR and Postgresql

2012-05-22 Thread Joshua Ulrich
get this working Thanks! Max Best, -- Joshua Ulrich | FOSS Trading: www.fosstrading.com __ R-help@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

Re: [R] Quantmod, Xts, TTR and Postgresql

2012-05-22 Thread Joshua Ulrich
hundread times) Then this: 1970-01-01 0.134920635 0.349206349 0.1778 snip 1970-01-01 0.734126984 0.996031746 0.78650794 On Tue, May 22, 2012 at 6:26 PM, Joshua Ulrich josh.m.ulr...@gmail.com wrote: On Tue, May 22, 2012 at 2:15 AM, R-type Studios rtypestud...@gmail.com wrote: Hi Everyone

Re: [R] package ‘build-essential’ is not available (for R version 3.0.2)

2013-11-11 Thread Joshua Ulrich
Have you read these instructions? http://cran.r-project.org/bin/linux/ubuntu/README.html They say to run sudo apt-get install r-base-dev which should install 'build-essential' (which is an Ubuntu package, not an R package). -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading

Re: [R] xts objects comparison

2013-11-14 Thread Joshua Ulrich
series1's index to yearmon, and the comparison works. index(series1) - as.yearmon(index(series1)) tail(series1 series2) GSPC 2013-06-01 TRUE 2013-07-01 TRUE 2013-08-01 TRUE 2013-09-01 TRUE 2013-10-01 TRUE 2013-11-01 TRUE Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading

Re: [R] Column Name Matching in xts Objects

2013-11-14 Thread Joshua Ulrich
))) dim(object) - c(length(object), 1) colnames(object)[NCOL(object)] - x } else { ... Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Merge xts and Return.portfolio

2013-11-15 Thread Joshua Ulrich
NA #2013-11-13 NANA 0.0067416934 #2013-11-140.010764042 0.0028130469NA Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com __ R-help@r-project.org mailing list

Re: [R] Installing quantstrat

2013-11-26 Thread Joshua Ulrich
that is the end of it. Does anyone know if it is possible to run quantstrat with the current version of R? Yep, see here: http://stackoverflow.com/q/11105131/271616 Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com

  1   2   >