[R] Visual details in integration of emacs, ess, Sweave (under aquamacs on OS X)

2007-09-01 Thread Ajay Shah
looking at. The solution perhaps involves the people who do auctex and the people who're writing ess to agree on how many pixels their toolbar will take, so as to avoid these jarring jumps. -- Ajay Shah http://www.mayin.org/ajayshah [EMAIL PROTECTED

[R] Bugreport on integration of Sweave and latex beamer

2007-08-31 Thread Ajay Shah
between Sweave and beamer. Are there some catches that I ought to know about? -- Ajay Shah http://www.mayin.org/ajayshah [EMAIL PROTECTED] http://ajayshahblog.blogspot.com *(:-? - wizard who doesn't know the answer

Re: [R] Bugreport on integration of Sweave and latex beamer

2007-08-31 Thread Ajay Shah
of each slide. This makes some other beamer features stop working, but I forget which. Thanks! This works. :-) -- Ajay Shah http://www.mayin.org/ajayshah [EMAIL PROTECTED] http://ajayshahblog.blogspot.com *(:-? - wizard who doesn't

Re: [R] maximum likelihood estimation

2007-07-19 Thread Ajay Shah
/documents/mle/mle.html might help. -- Ajay Shah http://www.mayin.org/ajayshah [EMAIL PROTECTED] http://ajayshahblog.blogspot.com *(:-? - wizard who doesn't know the answer. __ R-help

[R] Not able to understand the behaviour of boot

2007-05-26 Thread Ajay Shah
would you set about using tsboot() to obtain inference for this AR(1) coefficient? -- Ajay Shah http://www.mayin.org/ajayshah [EMAIL PROTECTED] http://ajayshahblog.blogspot.com *(:-? - wizard who doesn't know the answer

[R] How consistent is predict() syntax?

2007-04-13 Thread Ajay Shah
this? Is there a generic interface to the wide range of statistical tools in doing prediction? -- Ajay Shah http://www.mayin.org/ajayshah [EMAIL PROTECTED] http://ajayshahblog.blogspot.com *(:-? - wizard who doesn't know the answer

[R] Bug report on get.hist.quote

2005-11-02 Thread Ajay Shah
get.hist.quote(instrument=INR/USD, provider=oanda, start=2005-10-20) trying URL 'http://www.oanda.com/convert/fxhistory?lang=endate1=10%2F20%2F2005date=11%2F01%2F2005date_fmt=usexch=INRexch2=expr=USDexpr2=margin_fixed=0SUBMIT=Get+Tableformat=ASCIIredirected=1' Content type 'text/html' length

[R] Misbehaviour of DSE

2005-07-11 Thread Ajay Shah
Folks, I am finding problems with using dse: library(dse1) Loading required package: tframe Error: c(package '%s' required by '%s' could not be found, setRNG, dse1) library(dse2) Loading required package: setRNG Error: package 'setRNG' could not be loaded In addition: Warning message: there

[R] Trying to write a linear regression using MLE and optim()

2005-05-30 Thread Ajay Shah
I wrote this: # Setup problem x - runif(100) y - 2 + 3*x + rnorm(100) X - cbind(1, x) # True OLS -- lm(y ~ x) # OLS likelihood function -- ols.lf - function(theta, K, y, X) { beta - theta[1:K] sigma - exp(theta[K+1]) e - (y - X%*%beta)/sigma logl - sum(log(dnorm(e))) return(logl) }

[R] Puzzled at a trivial function using Hmisc::setps

2004-10-23 Thread Ajay Shah
with the setps() function of Hmisc::setps. Just in case it was R being unhappy with one-letter variable names, as sometimes happens, I also replaced f with file and that didn't help. -- Ajay Shah Consultant [EMAIL PROTECTED] Department

Re: [R] Making a 'joint distribution'?

2004-10-06 Thread Ajay Shah
Thanks to everyone who helped me solve this question. My cleanest solution is: joint.and.marginals - function(x,y) { t - addmargins(table(x, y)) rownames(t)[nrow(t)] - deparse(substitute(y)) colnames(t)[ncol(t)] - deparse(substitute(x)) return(t) } There are many other valid solutions,

[R] How might one write this better?

2004-10-04 Thread Ajay Shah
, it takes roughly 0.3 seconds per computation of Asset (on my dinky 500 MHz Celeron). I need to do 50,000 of these every now and then, and it's a pain to have to wait 3 hours. It'll be great if there is some neat R way to rewrite the little loop above. -- Ajay Shah

[R] Making a 'joint distribution'?

2004-10-04 Thread Ajay Shah
not able to figure it out. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi __ [EMAIL

[R] Computing and testing transition probabilities?

2004-10-04 Thread Ajay Shah
a test? -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi __ [EMAIL PROTECTED] mailing list

[R] `its' questions

2004-08-27 Thread Ajay Shah
docs. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi __ [EMAIL PROTECTED] mailing list

[R] Difficulties in starting up with its package

2004-08-25 Thread Ajay Shah
, 2004-05-17, 2004-05-18, 2004-05-19, 2004-05-20, 2004-05-21, 2004-05-24, 2004-05-25, 2004-05-26, 2004-05-27, 2004-05-28), r.inrusd)) -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org

Re: [R] Puzzled at lm() and time-series

2004-08-23 Thread Ajay Shah
() lm(y ~ x) works, then dx = diff(x,1) dy = diff(y,1) lm(dy ~ dx) should also work perfectly. :-) -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah

[R] Puzzled at lm() and time-series

2004-08-22 Thread Ajay Shah
, 119, 120, 121), class = data.frame) -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

[R] An entire data frame which is a time-series?

2004-08-17 Thread Ajay Shah
into man pages on each function (which is the only documentation that we have presently). -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New

[R] Elementary questions about data structures

2004-08-06 Thread Ajay Shah
,] = iterate(S[(i-1),]) } I get errors at line 1 saying Error: Object S not found If this could work, I know I'd be able to happily deal with the time-series vector S$x and the time-series vector S$y. Thanks a lot, -- Ajay Shah Consultant [EMAIL

[R] Question about manipulating quartiles

2004-07-31 Thread Ajay Shah
one persuade aggregate to do this? Thanks, -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

[R] Failing on reading a slightly big dataset

2004-07-05 Thread Ajay Shah
Debian packages for 1.9.1 today). -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

[R] More difficulties in getting data into R

2004-07-05 Thread Ajay Shah
=col2) col4 - read.table(file=col4) print(nrow(col2)) [1] 89323 print(nrow(col4)) [1] 88746 Why might I be getting 89,323 and 88,746 obs for two files which `wc' believes are each 89,323 lines long? I checked, and there is no single quote or C-m in either file. -- Ajay Shah

[R] Re: Seasonal ARMA model

2004-07-04 Thread Ajay Shah
be the meaning of mixing up both order and seasonal? E.g. what would it mean to do something like: arima(x,order=c(2,0,0),seasonal=list(order=c(2,0,0),period=12)) -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic

[R] SUMMARY: elementary sapply question

2004-06-22 Thread Ajay Shah
me: I'm not sure I was accurately articulating my question, but you helped me understand what I needed to find out. Thanks! Hope this posting helps someone else out there. -- Ajay Shah Consultant [EMAIL PROTECTED] Department

[R] Re: summaries (was: SUMMARY: elementary sapply question)

2004-06-22 Thread Ajay Shah
to do it for my own questions if it was at least a little common. :-) I'm an old geezer; have been posting summaries on newsgroups in this fashion since 1989. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic

[R] Elementary sapply question

2004-06-21 Thread Ajay Shah
that the list values that he'll iterate over fit in as y.values[i]. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

Re: [R] Elementary sapply question

2004-06-21 Thread Ajay Shah
) } and not for (i in 3:5) { f(3, i) } How would we force sapply to use one or the other interpretation? Thanks, -ans. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http

[R] Question on lists and vectors of lists

2004-06-17 Thread Ajay Shah
' value returned for the 400th firm. How would I do this? -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

[R] Date parsing question

2004-05-27 Thread Ajay Shah
How do I parse a date mmdd? I tried asking chron(s, ymd) but that didn't work. Would the date parsing routines of the Date class of 1.9 grok this? -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs

Re: [R] Moving window regressions - how can I improve this code?

2004-05-16 Thread Ajay Shah
) In the case of rollOLS, they say that an efficient addition and deletion algorithm is used for fast exection. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah

[R] Moving window regressions - how can I improve this code?

2004-04-23 Thread Ajay Shah
is vectorisable. I am using a loop to copy out from details$coefficients into the columns of results[i,]. Is there a better way? -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http

Evidence from Debian's package tracking (Was Re: [R] Size of R user base.)

2004-04-22 Thread Ajay Shah
while 4% are from Mac users. So for each Linux user, there are 4 Mac OS X users. But then, a lot of them are Aunt Tillie, and are unlikely to need anything more than a calculator. -- Ajay Shah Consultant [EMAIL PROTECTED

[R] Improving on edit()?

2004-04-22 Thread Ajay Shah
openoffice on it Pick up the resulting .csv file upon exit and return it. :-) My R knowledge doesn't yet support writing this.. Thanks, -ans. -- Ajay Shah Consultant [EMAIL PROTECTED] Department

[R] Re: Evidence from Debian's package tracking

2004-04-22 Thread Ajay Shah
of Debian users is an R user. Roughly one in three of the numerate users is an R user. The dangers with generalization... I don't have gnuplot on most of my machines. :-) Okay, okay, how about atmost 33% of the numerate users are R users. -- Ajay Shah

[R] Question on CAR appendix on NLS

2004-04-21 Thread Ajay Shah
reading the PDF file, and made minor changes) is attached. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi # John Fox has a book

Re: [R] trend turning points

2004-04-19 Thread Ajay Shah
a simple R program which illustrates the facilities and usage? -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

[R] Box-Ljung p-value - Test for Independence

2004-04-17 Thread Ajay Shah
value: , test$p.value, \n) # Runs test on Nifty test = runs.test(factor(sign(window$r.nifty))); cat(Runs test prob value: , test$p.value, \n) -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http

[R] In-sample / Out-of-sample using R

2004-04-14 Thread Ajay Shah
Sigmas of prediction errors -- All points used in estimation, in sample : 0.9405517 25 points used in estimation, in sample : 1.000709 25 points used in estimation, out of sample : 0.9586921 -- Ajay Shah Consultant [EMAIL

[R] A bug report?

2004-04-14 Thread Ajay Shah
-working notebook which runs Debian linux kernel 2.4.17, and have R 1.8.1 (2003-11-21). I use the `testing' branch of Debian. -ans. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org

[R] ARMA models with ARCH errors?

2004-04-11 Thread Ajay Shah
find mention of it in the tseries library. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

Re: [R] residuals with missing values

2004-04-04 Thread Ajay Shah
, and Brian Ripley said to me: If you have missing data in your data frame and want residuals for all observations, you need to use na.action=na.exclude, not the default na.omit. -- Ajay Shah Consultant [EMAIL PROTECTED

Re: [R] boot question

2004-04-04 Thread Ajay Shah
x-rnorm(20) mean(x) [1] -0.2272851 results-boot(x,mean,R=5) What in the world am I missing?? See http://www.mayin.org/ajayshah/KB/R/statistics.html -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic

Re: [R] Operating on windows of data

2004-03-22 Thread Ajay Shah
the sapply() is surely faster. But when the body of the for loop involves a weighty thing like a QR decomposition (for the OLS), that would seem to dominate the cost - as far as I can tell. -- Ajay Shah Consultant [EMAIL PROTECTED

Re: [R] Operating on windows of data

2004-03-21 Thread Ajay Shah
other clever thoughts? I'm not sure this is clever, but I use the subset capabilities of R. See http://www.mayin.org/ajayshah/KB/R/ols.html 3 of the examples there are related to your question, though it's still using loops. :-) -- Ajay Shah

[R] Plot 2 time series with different y axes (left and right)

2004-03-16 Thread Ajay Shah
axis 2 does not appear. Any ideas? Thanks again, -ans. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

Re: [R] Difficulties in interaction between R and latex (prosper)

2004-03-11 Thread Ajay Shah
ideas what I'm doing wrong? How do I get the graph made using R to sit horizantally (i.e. landscape), and fill the screen? I tried to say horizontal=T and that doesn't work. -- Ajay Shah Consultant [EMAIL PROTECTED] Department

[R] Difficulties in interaction between R and latex (prosper)

2004-03-10 Thread Ajay Shah
using R. Any ideas what I'm doing wrong? How do I get the graph made using R to sit horizantally (i.e. landscape), and fill the screen? I tried to say horizontal=T and that doesn't work. -- Ajay Shah Consultant [EMAIL PROTECTED

[R] Am failing on making lagged residual after regression

2004-03-08 Thread Ajay Shah
along? How do I get at the pure numbers of the residuals? Thanks much, -ans. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New

Re: [R] Find out the day of week for a chron object?

2004-03-03 Thread Ajay Shah
. :-) Could someone give me a glimmer into HOW and WHY that expression with(month.day.year(x), day.of.week(month,day,year)) works? :-) -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org

[R] Find out the day of week for a chron object?

2004-03-02 Thread Ajay Shah
. This seems quite odd. Any idea what I can do? Thanks, -ans. -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

[R] Stuck in trying to convert repetitive code into a function

2004-03-02 Thread Ajay Shah
passing by value? I looked at the standard docs and they seem to insist that a function can only send back one return value. How does a function send back multiple things that it has created? -- Ajay Shah Consultant [EMAIL PROTECTED

Re: [R] Nonparametric test of randomness (Run Test)

2004-03-02 Thread Ajay Shah
Suppose you have a returns vector r, which contains values like +3, -2, -7, +3, etc. Then say: require(tseries); test = runs.test(factor(sign(r))) print(test) If you want to access the prob value of the test from within a program, this is found in test$p.value -- Ajay Shah

[R] Confused in simplest-possible function

2004-02-29 Thread Ajay Shah
) :780 oneindex(A$lNifty) Min. 1st Qu. MedianMean 3rd Qu.Max. 854.2 1033.0 1089.0 1124.0 1179.0 1533.0 Here you see the median showing up as 1088.7 in the 1st case but 1089.0 in the 2nd case. How could that happen? -- Ajay Shah

[R] Need help on parsing dates

2004-02-23 Thread Ajay Shah
the next step: How do I tell R that I have a file full of data all of which is time-series data, where V1 is the datetime vector, and all the other columns are time-series, to do things like ARMA models and ts plots with? -- Ajay Shah Consultant [EMAIL

Re: [R] R: Including R plots in a Microsoft Word document

2004-02-22 Thread Ajay Shah
=LightSkyBlue, width=5, height=3) plot(A$dlusdchf, A$dlinrchf, xlab=USD/CHF returns, ylab=INR/CHF returns, col = dark red) -ans. -- Ajay Shah Consultant [EMAIL PROTECTED

Re: R for economists (was: [R] Almost Ideal Demand System)

2004-02-20 Thread Ajay Shah
On Thu, Feb 19, 2004 at 04:40:13PM -, Simon Cullen wrote: On Thu, 19 Feb 2004 19:06:08 +0530, Ajay Shah [EMAIL PROTECTED] wrote: snip R for economists Okay, I made a start, with http://www.mayin.org/ajayshah/KB/R/more.html Tell me what should go into it. :-) I think

Re: R for economists (was: [R] Almost Ideal Demand System)

2004-02-19 Thread Ajay Shah
Firstname R. Lastname on it ;-)). Does anybody in the list does know such a web page? If not, I will be happy if you, Ajay, could build and maintaine one. Okay, I made a start, with http://www.mayin.org/ajayshah/KB/R/more.html Tell me what should go into it. :-) -- Ajay Shah

[R] Bug report for fracdiff

2004-02-17 Thread Ajay Shah
I was sniffing in the fracdiff library (this is for fractionally integrated ARMA processes; Haslett and Raftery 1989). The documentation suggests that one tries the following simple example: library(fracdiff) ts.test - fracdiff.sim( 5000, ar = .2, ma = -.4, d = .3) fracdiff( ts.test$series, nar

[R] Subset function of lm(); rolling regressions

2004-02-09 Thread Ajay Shah
to R and so I might be missing out on very basic things. But I am unable to understand why this program does not print out the numbers from 1 to 10: for (i in 1:10) { i } Confused, -ans. -- Ajay Shah Consultant [EMAIL PROTECTED

[R] Subset function of lm() does not seem to work

2004-02-06 Thread Ajay Shah
Folks, I have an elementary question about the lm() function, where I'm trying to exploit the subset feature, to make it use only a subset of the observations. My code is: -- A - read.table(file=datafile.2,