[R] Help with time series

2009-10-21 Thread ehxpieterse
Hi there, I am having trouble getting the plotting of multiple time series to work. I have used RBloomberg to download data, which I then convert to a data frame. After I have calculated my new index values, I would like to plot the new index. My problem is that I can't get the plot feature to

[R] Seasonal analysis

2009-08-06 Thread ehxpieterse
Hi, Are there any R packages around which would break down a time series into a MxN table for analysis purposes? For example, show the total sales per month per calendar year. Jan Feb. Total 2008 2009 Total Thanks, Eduard -- View this message in context:

[R] Help with data type

2009-08-03 Thread ehxpieterse
Hi there, Using a quantmod function, I calculate the daily change between two points in a time series. However, I don't think I am using the data correctly. Code: getSymbols(^GSPC, src=yahoo) CloseData - Cl(GSPC) Delta - diff(CloseData, lag=1) for (i in 3:length(Delta)) { if

[R] Trouble with R proxy

2009-07-31 Thread ehxpieterse
Hi there, I am having some trouble getting download.file to work. I have been searching for the answer but my raw coding ability is not at the same level as the solutions I am getting. I have checked my environment and the proxy settings are in line with what I expected:

[R] Using ADF.Test

2009-06-09 Thread ehxpieterse
Hi, I am quite new to R and would appreciate some guidance, if possible. I have imported a csv file: spread - read.csv(Spread.csv) I get the following error when I try to run adf.test: adf.test(spread,alternative = c(stationary, explosive),0) Error in embed(y, k) : 'x' is not a vector or

Re: [R] Non-linear optimisation

2009-02-06 Thread ehxpieterse
Hi Ravi, To give you some background: The function compute_strategy_before_fees returns portfolio returns and standard deviation. Our optimal portfolio will maximise the returns whilst keeping the standard deviation at a certain level. We have an input matrix C that the function uses to

[R] Non-linear optimisation

2009-02-05 Thread ehxpieterse
Hi there, I have a piece of Matlab code I use to optimise a trding strategy. If there are any Matlab/R specialists out there, I would appreciate your help in doing the exact same optimisation in R. I suspect I would use nlm() in R but am not sure where to define my constraints. I have attached

[R] Debug help

2009-02-04 Thread ehxpieterse
Hi, I am getting the following error: argument is of length zero My code: temp - 0 for (j in 1 : 3) { for (k in 1 : 12) { temp - temp + as.double(C[k, (q - 1) * 3 + j]) * as.double(m_ret_reb[i + k - 1, j+1]) } } Why would R handle my temp variable as numeric(0)? Thanks -- View this message

[R] Date functions

2009-01-30 Thread ehxpieterse
Hi there, I am completely new to R and would like to do two things with date functions: 1. Compute any date from a specified starting point, e.g. x - 2 months 2. How do I determine the weekday of any given date? Thanks in advance -- View this message in context: