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
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
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
/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
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
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
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
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
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)
}
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
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,
, 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
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
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
docs.
--
Ajay Shah Consultant
[EMAIL PROTECTED] Department of Economic Affairs
http://www.mayin.org/ajayshah Ministry of Finance, New Delhi
__
[EMAIL PROTECTED] mailing list
, 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
()
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
, 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
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
,] = 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
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
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
=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
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
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
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
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
)
}
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
'
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
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
)
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
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
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
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
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
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
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
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
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
-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
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
, 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
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
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
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
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
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
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
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
. :-)
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
. 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
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
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
) :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
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
=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
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
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
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
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
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,
61 matches
Mail list logo