Hi:
I was wondering if someone could give me some examples of how to use
the "integrate" function to perform multi-dimensional quadrature? I
have a posterior density (up to a constant), for which I'd like to
evaluate the normalizing constant.
thanks for any help,
Ravi.
__
Hi:
I have written a Fortran program based on the Gaver-Stehfest algorithm,
which uses only real numbers (as opposed to the more powerful methods
using complex numbers). However, this can't be used in R since the
function specifying the inverse of the Laplace transform must also be
written in
Hi:
If your curve is in a 2-dim plane, then you can use the following
formula (in Tex notation):
\int_a^b \sqrt{1 + (\frac{df}{dx})^2} dx
So you need to take the derivative of your function first, and then
compute the integral of (1 + deriv^2) from a to b.
Here is a simple code to find the ar
Hi:
If your curve is in a 2-dim plane, then you can use the following
formula (in Tex notation):
\int_a^b \sqrt{1 + (\frac{df}{dx})^2} dx
So you need to take the derivative of your function first, and then
compute the integral of sqrt(1 + deriv^2) from a to b.
Here is a simple code to find th
Hi:
Has anyone linked TISEAN, which is a nonlinear time series analysis
package developed by Schreiber et al., with R? If not, are there
similar tools based on the phase-space representation of an observed
time series?
thanks,
Ravi.
__
[EMAIL PROTE
Take a look at the help for "RNGkind" as follows:
?RNGkind
Ravi.
- Original Message -
From: Silvia Perez Martin <[EMAIL PROTECTED]>
Date: Tuesday, December 16, 2003 12:45 pm
Subject: [R] Random Numbers
> Hello
>
> I´m a student from Spain. I couldn´t find something about R and I
> wa
Dear R group:
I am compiling a list of available algorithms/macros/software for
performing the following types of competing risks analyses:
(1) cumulative (crude) incidence regression
(2) Gray's K-sample log-rank test for cmulative incidence
(3) multi-state models
(4) dependent competing risks mo
Dear Group:
I am trying to create a model frame from a formula for the model as
follows:
formula <- y ~ x1 + x2 + x3
X <- model.frame(form=formula,data=mydata)
I have some missing values in some the variables, but I want them to be
included in my model frame and to be indicated as "NA". Is the
Here is a recursive function.
iterate <- function(f, n, x){
if(n==0) return(x)
iterate(f, n-1, f(x))
}
iterate(function(x) 1/(1+x), 10, 1)
Best,
Ravi.
- Original Message -
From: Tobias Verbeke <[EMAIL PROTECTED]>
Date: Thursday, June 5, 2003 12:04 pm
Subject: Re: [R] dynamics of func
Hi:
I was wondering why Marsaglia's new ziggurat method for generating
deviates from the standard normal distribution has not been implemented
in the R base package. I know that it is available in SuppDists
pacakage of Bob Wheeler, as "rziggurat". According my timing tests, it
is about 6 to 7
How about "rms.curv" function in the MASS library?
Ravi.
- Original Message -
From: Ivone Figueiredo <[EMAIL PROTECTED]>
Date: Monday, June 2, 2003 4:40 am
Subject: [R] Help - Curvature measures of nonlinearity
> Dear colleagues,
>
> Von Bertalanffy model is commonly adjust to data on
Dear Spencer:
In the following example, your code doesn't pick up the local mode at 5.
> x2 <- c(1,1,2,3,3,3,3,5,5,5)
> modes(x2)
[1] 1 3
In this example, it gives a mode at 7, which is incorrect.
> x2 <- c(1,1,2,3,3,3,3,5,5,5,6,7)
> modes(x2)
[1] 1 3 7
Ravi.
- Original Message -
Fro
Hi:
This is not a typical R posting, but I was quite surprised to read
Prof. Ripley's comment about the inappropriate use of AIC to
compare "non-nested" models. As he says, While it is indeed true that
Akaike's (1973) develops AIC for nested models, i.e. models which can
be obtained by variou
Hi:
I create a hermitian matrix and then perform its singular value
decomposition. But when I put it back, I don't get the original
hermitian matrix. I am having the same problem with spectral value
decomposition as well.
I am using R 1.7.0 on Windows. Here is my code:
X <- matrix(rnorm(16)
Re: [R] SVD and spectral decompositions of a hermitian matrix
> On Thu, 3 Jul 2003, Ravi Varadhan wrote:
>
> > I create a hermitian matrix
>
> You didn't succeed, if you meant Hermitian.
>
> > and then perform its singular value
> > decomposition. But when
Hi:
I am using R 1.7.0 on Windows. I am having trouble getting "outer" to
work on one of my functions. Here is a simple example illustrating my
problem:
> b1 <- c(1.2,2.3)
> b2 <- c(0.5,0.6)
> x <- c(3e+01, 1e+02, 3e+02, 5e+02, 1e+03, 1e+04, 1e+05, 1e+06)
> y <- c(2,4,2,5,2,3,1,1)
> n <- c(5,
Hi Tao:
The P-values for 2x2 table are generated based on a random (discrete
uniform distribution) sampling of all possible 2x2 tables, conditioning
on the observed margin totals. If one of the cells is extremely small,
as in your case, you get a big difference in P-values. Suppose, you
change
As the help page for "qr" says, LAPACK does not attempt to detect
linear dependencies or rank deficiencies, so you should not use the
value of "rank" obtained with argument, LAPACK = TRUE. Computing the
rank of a matrix using finite precision is difficult, as the example on
the help page for "
Vincent:
Here is a simple solution using Prof. Bates' non-linear least squares
algorithm:
Best,
Ravi.
> Phytopath <- data.frame(x=c(0, 0.03, 0.1), y=c(28, 21, 11))
> Phyto.nls <- nls(y ~ Ymax/(1 + x/x50),data=Phytopath,start=list
(Ymax=20.0,x50=0.01),trace=T)
404.3058 : 20.00 0.01
15.76932
Thanks Peter, for the wonderful illustration of various model-fitting
options for the non-linear models.
Thinking about your comment that the "variance stabilizing" transform
does better than the weighted non-linear least-squars - I am
interpreting this to mean that the residual sum of squares
Hi All:
Along the lines of this thread, I was wondering about the usefulness of
putting together a package for numerical differentiation, to perform
tasks such as gradient, jacobian, and hessian calculations for exact
functions, as well as for noisy functions (via some type of smoothing).
Base
Hi:
Suppose I have the following vector:
> x <- c(1,4:8,11,13:14,17,19,23:28,35:38)
> x
[1] 1 4 5 6 7 8 11 13 14 17 19 23 24 25 26 27 28 35 36 37 38
>
and I would like to pick out the first and last indices of all the
consecutive "runs" of integers, where the length of a run is no smal
Hi:
Is it possible to perform computations in quadruple precision (more generally, with
more digits in the floating-point arithmetic than that allowed by double precision)
in R?
thanks,
Ravi.
[[alternative HTML version deleted]]
__
[EMAI
Hi:
I have two matrices, A and B, where A is n x k, and B is m x k, where n >> m >> k. Is
there a computationally fast way to count the number of times each row (a k-vector) of
B occurs in A? Thanks for any suggestions.
Best,
Ravi.
[[alternative HTML version deleted]]
___
g the occurrences of vectors
Ravi Varadhan jhsph.edu> writes:
> Hi:
>
> I have two matrices, A and B, where A is n x k, and B is m x k, where n >> m
>> k. Is there a computationally fast way to
> count the number of times each row (a k-vector) of B occurs in A? Than
Hi:
I have data from an assay in the form of two vectors, one is response
and the other is a predictor. When I attempt to fit a 5 parameter
logistic model with "nls", I get converged parameter estimates. I also
get the same answers with "gnls" without specifying the "weights"
argument.
Howeve
-Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Ravi Varadhan
> Sent: Wednesday, January 14, 2004 6:11 PM
> To: [EMAIL PROTECTED]
> Subject: [R] Generalized least squares using "gnls" function
>
>
> Hi:
>
>
ays had trouble with this form of varPower (even in S). I
> just
> wonder if form = ~fitted(".") might work.
>
>
> On Thu, 15 Jan 2004, Ravi Varadhan wrote:
>
> > Dear Christian:
> >
> > That is not the problem, but thanks for your attempted help. I
> s
Hi:
In R, how can I "data.restore" an object that was "data.dump"ed in
Splus (I am not sure of the exact version, but probably Splus5)?
When I use data.restore, I get the following error message (I am using
R 1.7.0 on Windows)
> data.restore("n2.suicide")
Error in ReadSdump(TRUE, " ") : S
mod
Hi All:
I am really fascinated by the content and the depth of discussion of
this thread. This really exemplifies what I have come to love and
enjoy about the R user group - that it is not JUST an answering service
for getting help on programming issues, but also a forum for some
critical and
You reall have only one parameter in your model, c = a/b. You can't
identify both a and b from your model, therefore, you should fit the
linear model: lm(z ~ c* sin(x)/x)
Ravi.
- Original Message -
From: cstrato <[EMAIL PROTECTED]>
Date: Monday, February 2, 2004 2:28 pm
Subject: [R] Ro
A small correction to my previous email:
You actually specify the following call to lm:
y <- sin(x)/x
lm(z ~ y - 1)
to make sure that the intercept is not estimated.
Ravi.
- Original Message -
From: Ravi Varadhan <[EMAIL PROTECTED]>
Date: Monday, February 2, 2004 2:46 pm
Su
my previous
posting.
# For example:
library(ftnonpar)
plot(dclaw(seq(-3,3,len=1000)),type="l")
xx <- rclaw(500)
pmden(xx,verbose=T)
Best,
Ravi.
- Original Message -
From: Ravi Varadhan <[EMAIL PROTECTED]>
Date: Tuesday, February 24, 2004 4:23 pm
Subject: Re: [R] Computi
I remember Prof. Ripley suggesting the "taut springs" approach to
estimating the modes, sometime ago in a posting to this group. I would
be interested in knowing whether there is any R implementation of this
approach (developed by Davies (1995)), for both non-parametric
regression and density e
An even simpler solution is:
mat2 <- 1 * (mat1 > 0.25)
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins Univ
> ans1 <- solve(t(X)%*%X,t(X)%*%y)
> ans2 <- qr.solve(X,y)
> all.equal(ans1,ans2)
[1] TRUE
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medici
You can divide your domain of integration into smaller intervals and then
add up the individual contributions. This could improve the speed of
adaptive Gauss-Kronrod quadrature used in integrate().
Ravi.
---
Ravi
ihood doesn't
have to concave. I remember reading something about this in
Barndorff-Nielsen and Cox's book on Inference and Asymptotics. There may be
better references.
Ravi.
--
Ravi Varadhan, Ph.D.
Assistant Profess
elps,
Ravi.
--
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL
of Computational and Graphical Statistics, Vol. 3, No. 2
(Jun., 1994), pp. 214-233.
I don't know of any more recent ones.
Ravi.
--
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Divisi
om the
following (where the resultant vector is not zero):
> deg(circ.mean(c(rad(211),rad(30 # note 211 = -149 (mod 360)
[1] -59.46
which is perfectly alright.
Hope this helps,
Ravi.
------
Ravi Varadhan, Ph.D.
A
Min. 1st Qu. MedianMean 3rd Qu.Max.
0.060 0.100 0.110 0.128 0.170 0.190
> summary(f3time)
Min. 1st Qu. MedianMean 3rd Qu.Max.
0. 0.0300 0.0950 0.0779 0.1100 0.1300
Ravi.
------
Ravi V
Look at the function "rggamma" in J.K. Lindsey's package "rmutil".
------
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Ho
.
Best,
Ravi.
--
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL PROTECTED
Hi,
I didn't verify your formulas for Fieller's method of computing the
confidence interval. A slightly simpler approach is to use the Delta method
to compute the CI. It is also valid for any link function. It yields a
simpler formula for the variance of EC50 (for any link function):
varEC50 <-
Hi,
This is not an R related question and I apologize for that, but given the
brain power of the R community it is hard for me to resist posting this
here.
I have a problem where each participant is shown a series of visual cues
(displayed on a computer screen in a random order) and asked t
Here is an example that shows how to divide a vector into "quartiles" and
create a categorical (factor) variable with 4 levels ("A", "B", "C", "D")
from it:
x <- rnorm(100)
xcat <- factor(cut(x, quantile(x), include.lowest = TRUE),
labels = LETTERS[1:4])
table(xcat)
Ravi.
> --
Hi,
I would like to write a one-line R code to create a 3-dim array, B, of
dimension (n,n,m) from a matrix, A, of dimension (m,n) such that the i-th
element of the 3-dim array, B[, , i] is the outer product of the i-th row
of A.
Thanks for any help,
Ravi.
[[alternative HTML ve
Hi,
To find the area lying between the curve y = y(x) and 45 degree line (which,
assuming it goes through the origin, is y = x), you can use the following
function based on trapezoidal rule:
trap.rule <- function(x,f) {sum(diff(x)*(f[-1]+f[-length(f)]))/2}
trap.rule(x,f=y-x)
This area will be n
Hi Todd,
Here is a function that was suggested to me by Gabor Grothendieck. This
function counts the number of times each row of a matrix B occurs in another
matrix A.
rowmatch.count <- function(a,b) {
f <- function(...) paste(..., sep=":")
a2 <- do.call("f", as.data.frame(a))
b2 <-
As suggested by Prof. Ripley, you should read a good book in the optimization
area. One that I would highly recommend is the book by Dennis and Schnabel
(1983) - Numerical methods for unconstrained optimization, which does a great
job of explaining both "line-search" and "trust-region" approach
tting Trust-Region"
To: RAVI VARADHAN <[EMAIL PROTECTED]>
Cc: Prof Brian Ripley <[EMAIL PROTECTED]>, Martin Ivanov <[EMAIL PROTECTED]>,
r-help@stat.math.ethz.ch
> May I also suggest Bates and Watts (1988) Nonlinear
> Regression
> Analysis and Its Application
y in their discussion of Efron et al (2004) describe a
LARS-type algorithm for generalized linear models. Has anyone implemented
this in R?
Thanks for any help.
Best,
Ravi
-------
Ravi Varadhan, Ph.D.
Assistant
ity score as weights) should
be reasonable. Am I right?
I would appreciate comments on these points.
Thanks very much.
Best,
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and
varying time steps.
R has very limited functionality for handling differential equations. So,
you should look for FORTRAN libraries, from which you can create DLLs to be
used in R.
Hope this help,
Ravi.
---
Ravi
for all t.
Hope this is clear. You should also consult a basic numerical analysis
text, for example, Burden and Faires (2001, 7th Edition, pages 704 - ...).
Best,
Ravi.
-------
Ravi Varadhan, Ph.D.
Assistant Prof
ams to be "X1",
"X2", etc.
Any help is appreciated.
Best,
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
in accurate Hessian of the
log-likelihood.
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-26
X1","X2","X3","X4")
par(mfrow=c(2,2))
apply(X, 2, function(x)truehist(x))
In this example, I would like the x-labels of the histograms to be "X1",
"X2", etc.
Any help is appreciated.
Best,
Ravi
--
Thank you, Marc and Gabor. I apologize for having missed Gabor's reply.
Best regards,
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicin
It is interesting to note that the above algorithm converges if we use the
infinity norm, instead of the 1-norm, to scale the rows and columns, i.e. we
divide rows and columns by their maxima.
Best,
Ravi.
----
---
Ravi Var
c(HR) will do it.
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614
gy for picking a starting
value) and different optimization methods (e.g. conjugate gradient with
"Polak-Ribiere" steplength option, Nelder-Mead, etc.).
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Profes
Hi,
qr(A)$rank will work, but just be wary of the tolerance parameter (default
is 1.e-07), since the rank computation could be sensitive to the tolerance
chosen.
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant
t;- -(7:16)
> tol <- 10^exp
> sapply(tol, A=hilbert(20), function(x,A)qr(A, tol=x, LAPACK=FALSE)$rank)
[1] 10 12 14 14 15 16 16 17 18 19
> sapply(tol, A=hilbert(20), function(x,A)qr(A, tol=x, LAPACK=TRUE)$rank)
[1] 20 20 20 20 20 20 20 20 20 20
Looking forward to comments.
Best,
Ravi.
No.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL
, method = "CG", y = women$J, X = cbind(1,
women$M, women$S))
> out
$par
[1] -3.0612277 -1.4567141 0.3659251
$value
[1] 13.32251
$counts
function gradient
357 101
$convergence
[1] 1
$message
NULL
Hope this helps,
Ravi.
--
tly.
Ravi.
-------
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL PROTECTED]
Webpage: http://www
Why do you want to look at parameter estimates for each step, anyway?
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopk
r constraints.
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL PROTECTED]
Webpage: http://www.jhsph.edu/a
Check out the function "mvrnorm" in package MASS.
library(MASS)
?mvrnorm
Ravi.
-------
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontolo
Harold,
I totally echo your sentiments on the difficulty of creating an R package in
Windows. I really wish that this process could be made a bit less painful.
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant
re made to be orthonormal.
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL PROTECTED]
Webpage: http://www
point).
However, I do not why optim converges to the boundary maximum, when analytic
gradient is supplied (as shown by Sundar).
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
e solution provided by R is correct or not. In the
> case that I reported, it is fairly simple to see that the solution
> provided by R (without any warning!) is incorrect, but, in general,
> that is not so simple and one may take a wrong solution as a correct
> one.
>
> Pau
avi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL PROTECTED]
Webpage: http://www.jhsph.edu/agingandhealth/Peo
sequential unconstrained minimization techniques.
Another good book is that by Roger Fletcher (1987): Practical methods of
optimization.
Ravi.
-------
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
"significantly" different but the corresponding parameter estimates differ
widely, then you may have identifiability issues.
Ravi.
-------
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
D
atanh(A + beta)
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL PROTE
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL PROTECTED]
Webpage: http://www.jhsph.edu/agingand
You could try that.
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: [EMAIL PROTECTED]
Webpage: http://www.jhsph.edu/agingandhealth/People/Fa
Dear Martin and Vitto,
Please find attached the R function to compute the density of the ratio of 2
dependent normal variates.
Best,
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and
Your data is "compositional data". The R package "compositions" might be
useful. You might also want to consult the book by J. Aitchison: statistical
analysis of compositional data.
Ravi.
----
---
Hi Paul, Tolga, and others:
I had also written some codes to compute derivatives, jacobians, and
Hessians. Please see the attached file for the code. I will be happy to
help out with the development of a package and/or with the documentation
process.
Best,
Ravi.
> -Original Message-
>
Hi Marie,
Here is a function that I wrote based on the "JT.test " function in package
"SAGx", to account for missing values and to order based on the groups.
JT.fun <- function(y, g) {
nas <- is.na(y) | is.na(g)
ord <- order(g[!nas])
d <- y[!nas][ord]
g <- g[!nas][ord]
return (JT.test(dat
Dominik,
Adding (1) and (2) yields,
A(t) + B(t) = constant = A(0) + B(0) = c
So, plug in B = c - A in (1) and solve for A. This should be an easy
solution.
Hope this is helpful,
Ravi.
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:r-help-
> [EMAIL PROTECTED] On Behalf Of Peter
Try this:
> atan2(1+0i,1i)
[1] NaN-Infi
Ravi.
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:r-help-
> [EMAIL PROTECTED] On Behalf Of Robin Hankin
> Sent: Tuesday, March 28, 2006 9:13 AM
> To: RHelp
> Subject: [R] atan2(1,1i)
>
> Hi
>
> ?atan2 says that atan2(y,x)=atan(y/x) for
tions.
------
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins Univerisity
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: <mailto:[EMAIL PROTECTED]> [EMAI
tions.
------
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins Univerisity
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: <mailto:[EMAIL PROTECTED]> [EMAI
) = D_{n-1}(\lambda) M(\lambda).
Is there a way to use this theorem and the "polynomial" library to compute
the minimal polynomial?
Thanks once again,
Ravi.
--
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on
.
--
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins Univerisity
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: <mailto:[EMAIL PROTECTED]> [EMAIL PRO
This should do it:
matrix(unlist(mylist),nrow=length(mylist), by=T)
--
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph
Isn't Bell number different from the number of partitions, P_n, of a number,
n?
Bell number, B_n, is the number of subsets into which a set with "n"
elements can be divided. So, B_3 = 5, and B_4 = 15, whereas P_3 = 3, and
P_4 = 5. Bell numbers grow much more rapidly than the number of partitions
(-2q) \Gamma(n+1) / 2^(n+1).
Hope this helps,
Ravi.
--
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax
Tolga,
Have you considered an EM algorithm for your factor analysis problem? A
reference for this is:
Rubin, D. and Thayer, D. (1982). EM algorithms for ML factor analysis.
Psychometrika, 47(1):69--76.
Hope this is helpful,
Ravi.
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:
Hi,
How can I add legends in the "xyplot" function, in the "lattice" library?
Here is a simulation example:
x <- runif(90)
z <- sample(1:3, 90, rep=T)
y <- rnorm(90, mean = x^2 + z, sd=1)
library(lattice)
trellis.par.set(col.whitebg())
xyplot(y ~x, groups=as.factor(z), type = c('p',
o indicate the 3 different smoothed curves.
Can someone give me a simple example or show how to do this for my example?
Thanks very much,
Ravi.
> -Original Message-
> From: Uwe Ligges [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 17, 2006 3:08 AM
> To: Ravi Varadhan
&
Hi,
I am using the "xyplot" function in the "lattice" package to generate
multiple plots, but I would like to have them plotted on the same page. I
would like to set something equivalent to the command: par(mfrow=c(2,2)),
in order that I can plot 4 xyplots on the same page. How can I do this
Ravi.
> -Original Message-
> From: Liaw, Andy [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 31, 2006 1:04 PM
> To: 'Ravi Varadhan'; r-help@stat.math.ethz.ch
> Subject: RE: [R] Multiple xyplots on the same page
>
> See ?print.trellis.
>
>
1 - 100 of 207 matches
Mail list logo