://cran.r-project.org/doc/manuals/r-release/R-exts.html#Checking-and-building-packages
).
On Thu, May 9, 2013 at 11:27 AM, David Reiner david.rei...@xrtrading.comwrote:
I'm running DEoptim - it works great!
(A HUGE THANK YOU to David Ardia, Katharine Mullen, Brian Peterson, and
Joshua Ulrich
I also cannot reproduce the crash.
sessionInfo()
R version 2.11.1 (2010-05-31)
x86_64-unknown-linux-gnu
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8
by members of the program committee, including
Dirk Eddelbuettel, John Fox, Virgilio Gomez-Rubio,
Richard Heiberger, Torsten Hothorn, Aaron King, Jan de Leeuw,
Nicholas Lewin-Koh, Andy Liaw, Uwe Ligges, Martin Maechler,
Katharine Mullen, Heather Turner, Ravi Varadhan, H
Participants in the R User Conference, useR! 2010, July 21-23,
(http://R-project.org/useR-2010) will each receive a t-shirt, thanks to
the sponsorship of Mango Solutions (http://www.mango-solutions.com/).
This email is a call for designs for the front of the t-shirt. The design
should be made
This is a reminder that the regular registration deadline for the useR!
2010 conference, July 21-23 (http://www.R-project.org/useR-2010) is today.
After today, late registration will be possible until June 20th.
The link to submit registration information is:
, Torsten Hothorn, Aaron King, Jan de Leeuw,
Nicholas Lewin-Koh, Andy Liaw, Uwe Ligges, Martin Maechler,
Katharine Mullen, Heather Turner, Ravi Varadhan, H. D. Vinod,
John Verzani, Alan Zaslavsky, Achim Zeileis.
The program will cover topics such as
* Applied
I will consider putting methods for AIC and logLik into the next version
of minpack.lm (contributions welcome).
For now, the following should work for logLik, where 'object' is the
return value of nls.lm.
logLik.nls.lm - function(object, REML = FALSE, ...)
{
res - object$fvec
N -
The abstract submission deadline for the R Users Conference, useR! 2010,
is just one month away.
Submission deadline: 2010-03-01
Early registration will also close on 2010-03-01.
Now is the perfect time to prepare an abstract presenting innovations or
exciting applications of R. The call
=list(A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,K=0))
HP
matplot(cbind(log(fitted(HP)), log(tx.br)),type=l)
- Original Message -
From: Katharine Mullen k...@few.vu.nl
To: AneSR citb...@terra.com.br
Cc: r-help@r-project.org
Sent: Thursday, December 10, 2009 9:55 PM
Subject: Re: [R] non-linear
You did not provide the data or a way of generating it.
I would guess that Excel finds the same solution (the same residual sum-of
squares) as nls but that it uses a weak convergence criterion and/or does
not give you information regarding why it terminates.
Regarding the step size: you can set
You used starting values:
pa - c(1,2,3)
but both algorithms (port and Gauss-Newton) fail if you use the slightly
different values:
pa - c(1,2,3.5)
Scaling does not fix the underlying sensitivity to starting values.
pa[3] in particular cannot be above ~3.15 for GN and ~3.3 for port; both
If you could reformulate your model as alpha * (y0 + E^t) then you could
use nls with alg=plinear (alpha then would be eliminated from the
nonlinear param and treated as conditionally linear) and this would help
with convergence.
Else you can try package DEoptim to get the starting values; the
/
**
We hope to meet you in Gaithersburg!
The organizing committee,
Kevin Coakley, Nathan Dodder, David Gil, William Guthrie,
Walter Liggett, John Lu, Katharine Mullen, Jonathon Phillips,
Antonio Possolo, Ravi Varadhan.
___
r
to plot
the intermediate populations if provided.
o The package maintainer has been changed to Katharine Mullen,
katharine.mul...@nist.gov.
o A NAMESPACE has been added.
o Argument FUN for DEoptim is now called fn for compatibility with
optim.
o demo file has been removed
or use nls.lm as in
install.packages(minpack.lm)
library(minpack.lm)
x - c(2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74)
y - c(100, 99, 99, 98, 97, 94, 82, 66, 48, 38, 22, 10, 1)
res - function(p, x, y) y - ff(p,x)
ff - function(p, x) 100*exp(p[1]*(1-exp(p[2]*x))/p[2])
aa -
Using algorithm=plinear as shown by example below makes
sum-of-exponentials fitting problems better conditioned.
A1 - 1
A2 - 2
k1 - -.5
k2 - -2
x - seq(1,10,length=200)
y - A1*exp(k1*x) + A2*exp(k2*x) + .001*rnorm(200)
aa - nls(y~cbind(exp(k1*x), exp(k2*x)), algorithm=plinear,
see the fmingr function in src/main/optim.c
(https://svn.r-project.org/R/trunk/src/main/optim.c)
On Wed, 25 Feb 2009 rkevinbur...@charter.net wrote:
I have read that when the gradient function is not supplied (is null)
then first order differencing is used to find the differential. I was
Hoi Bart,
I think you're right that ALS should be applicable to this problem.
Unfortunately in writing I see that there is a bug when the spectra are
NOT constrained to nonnegative values (the package has been used to my
knowledge only in fitting multiway mass spectra thus far, where this
are welcome. If you
think a new category, package or function should be added, please mail.
best regards,
Kate Mullen
Katharine Mullen
mail: Department of Physics and Astronomy, Faculty of Sciences
Vrije Universiteit Amsterdam, de Boelelaan 1081
1081 HV Amsterdam, The Netherlands
room: T.1.06
you can combine write and write.table, using append=TRUE.
e.g.,
write1 - function(txt, mat, filename) {
for(i in 1:length(txt)) {
write(txt[i], file=filename, append=i!=1)
write.table(mat[[i]], file=filename, append=TRUE,sep =\t)
}
}
t - c(text1, text2, text3)
m -
The following code is inspired by the help file for the relist()
function (see?relist), which explicitly details how you can use a
The example is in the 'Details' section and, indeed, it looks like it no
longer works.
relistable object in conjunction with optim to pass and reconstruct
It is not an R package, but rather a collection of Fortran functions
that R uses from netlib:
http://www.netlib.org/port/
On Wed, 9 Jul 2008, Jos Kaefer wrote:
Hi
When I type:
?nls
I come across this section:
algorithm: character string specifying the algorithm to use. The
Dear Petr,
I think it's a feature. the formula interface also won't let you specify
the slots of S4 objects in the model spec.
How about
coef(nls(y~a*x^b, data=list(x=DF[,1], y=DF[,2]), start=list(a=3, b=.7)))
?
On Thu, 26 Jun 2008, Petr PIKAL wrote:
Dear all
Nobody responded to my
by example:
slope - 45
plot(1:10)
text(2, 7, labels = expression(45~degree)) ;
text(2, 5, labels = substitute(paste(slope * degree), list(slope=45)))
text(2, 3, labels = substitute(paste(lambda * = * mt * (nm)),
list(mt = 33)))
On Thu, 19 Jun 2008, Thompson, David (MNR) wrote:
Hello,
I also noticed that adding a custom axis with image.plot was a problem;
you can also do:
library(fields)
m - matrix(1:15,ncol=3)
par(mar=c(5,5,5,7))
image(m, axes=FALSE)
# add axis
axis(1,axTicks(1),lab=letters[1:length(axTicks(1))])
box()
## add legend
image.plot(m, legend.only=TRUE)
Here is an example w/optim where you have an objective function
F(x) where you have (possibly a few) constraints of form x_i=x_j, and you
can specify the constraints flexibly, which is what I _think_ you want.
An example from you would have been nice.
## objective function that depends on all
.
## for constraint a=b
xx - optim(par=list(b=-4, c=-.1), fn=fr, eqspec=list(a=b),
dd=dd, obfun=obfun)
## for constraint b=a
x1 - optim(par=list(a=-3, c=-.1), fn=fr, eqspec=list(b=a),
dd=dd, obfun=obfun)
On Sun, 8 Jun 2008, Katharine Mullen wrote:
Here is an example w/optim where
Dear Maura,
try the function textplot from the package gplots. you can say
textplot(yourmatrix) and get a plot of a character matrix.
On Fri, 6 Jun 2008, Maura E Monville wrote:
I would like to generate a graphics text. I have a 67x2 table with
5-character string in col 1 and 2-character
dydata
x1 x2 y
1 9 27 248
2 9 22 213
3 4 23 190
4 11 16 183
5 -6 25 144
6 11 14 169
7 -4 13 72
8 2 8 73
9 10 13 156
10 8 30 263
11 12 10 147
12 -7 5 -2
13 0 10 75
14 12 0 77
15 9 8 115
16 12 24 245
17 34 23 370
18 12 1 84
19 10 37 324
20 26 30 371
weight -
try:
vol - rep(c(0.03, 0.5, 2, 4, 8, 16, 32), 3)
time - rep(c(2,4,8),each=7)
p.mated - c(0.47, 0.48, 0.43, 0.43, 0.26, 0.23, NA, 0.68, 0.62, 0.64,
0.58, 0.53, 0.47, 0.24, 0.8, 0.79, 0.71, 0.56, 0.74, 0.8, 0.47)
eury - data.frame(vol=vol, time=time, p.mated=p.mated)
eury - na.omit(eury)
p0 -
Dear Spencer,
I just saw your post.
If the singular gradient happens during or after iteration one (that is,
not at the initial estimates), then calling summary on the nls output
would give standard error estimates on the parameters useful for
diagnostics. You could also call
it for nlrob();
if you find a way to you it for nls() , then the same should
work for nlrob().
I'm CCing this to the specialists for Robust Stats with R
mailing list, R-SIG-robust.
Best regards,
Martin Maechler
ETH Zurich
KateM == Katharine Mullen [EMAIL PROTECTED]
on Fri, 9 May 2008 15
Thanks for the details - it sounds like a bug. You can either send me the
data in an email off-list or make it available on-line somewhere, so that
I and other people can download it.
On Fri, 9 May 2008, elnano wrote:
Thank you Katharine. I am certain nprint is affecting my solution. Let me
://ftp.bgc-jena.mpg.de/pub/outgoing/fmoyano
Katharine Mullen wrote:
Thanks for the details - it sounds like a bug. You can either send me the
data in an email off-list or make it available on-line somewhere, so that
I and other people can download
the argument par is a list, calling
summary on the output of nls.lm was not working.
I'll submit the new version to CRAN soon.
This disscusion has been fruitful - thanks for it.
On Fri, 9 May 2008, Katharine Mullen wrote:
You indeed found a bug. I can reproduce it (which I should have tried
(depending on the dataset) gives me completely wrong parameter
estimates resulting in negative predicted values. Maybe someone has a
suggestion here.
Fernando
Katharine Mullen wrote:
The error message means that the gradient (first derivative of residual
vector with respect to the parameter
recall that 0 ^{-.2} = 1/0^{.2}, and that dividing by 0 gives Inf.
so when 0 is in trl, part of your model for RT is Inf:
trl - 0:14
p - -.2
cbind(1,trl, trl^p)
trl
[1,] 1 0 Inf
[2,] 1 1 1.000
[3,] 1 2 0.8705506
[4,] 1 3 0.8027416
[5,] 1 4 0.7578583
[6,] 1 5
[EMAIL PROTECTED] 4/18/2008 6:02 PM
Hi,
using something like
lower=c(1e-5,1e-5,1e-5),upper=c(1-1e-5,Inf,Inf)
is even more safer since it sometime evaluates the function slightly
outside the lower and upper limits.
cheers
Thomas
Katharine Mullen wrote:
I'm not going to look
I'm not going to look into what's happening in-depth but it looks like the
bounds for your parameters need to be set with care; the below (with
slight re-def. of your residual function) gives results that seem to match
vglm approximately, with 1e-10 standing in for a bound of 0 and 1-e-10
standing
do.call(rbind, list.foo)
On Fri, 18 Apr 2008, Andrew Yee wrote:
Is there an efficient way to use rbind() with the five dataframes described
in the following example:
a - c(1:5)
list.foo - lapply(a, function(x) data.frame(beta=a*rnorm(10),
deta=a*rnorm(10)))
big.data.frame -
Dear Bryan,
For work in that general direction, look at the R News that was on 'R in
chemistry' (Volume 6/3, August 2006,
http://www.r-project.org/doc/Rnews/Rnews_2006-3.pdf) and the special vol.
of the Journal of Statistical Software on 'Spectroscopy and Chemometrics
in R' (vol 18,
if your matrix is stored in a text file then
xx - read.table(x, na.strings=NULL)
where x is the name of the text file.
On Thu, 17 Apr 2008, Tim Smith wrote:
Hi,
I had a matrix with NULL values, which I wanted to replace with NA. Is there
an efficient way to do this?
Small sample input
you look at the number of observations, and the number of parameters,
and take the smaller of the two. if the estimated rank of the weighted
gradient is small than this number, you stop.
On Fri, 28 Mar 2008, Katharine Mullen wrote:
A QR decomposition is done on the weighted gradient matrix
A QR decomposition is done on the weighted gradient matrix; if the
estimate of the rank that results is less than the number of columns in
the gradient (the number of nonlinear parameters), or less than the number
of rows (the number of observations), nls stops.
You can see the calls in the
The package minpack.lm allows nonlinear regression problems to be
addressed with a modification of the Levenberg-Marquardt algorithm based
on the implementation of 'lmder' and 'lmdif' in MINPACK. Version 1.0-8 of
the package is now available on CRAN.
Changes in version 1.0-8 include:
o
It is in the VR bundle (collection of packages), which is 'recommended',
so it is included in all binary distributions of R; if you have the source
code you find VR in R-2.6.2/src/library/Recommended
On Sat, 8 Mar 2008, Svyatkovskiy Alexey wrote:
Hello,
Tell me please, can I get a sourcse
There is some information and references regarding the name 'normal' in
the internet article 'Earliest Known Uses of Some of the Words of
Mathematics (N)', http://members.aol.com/jeff570/n.html, by John Aldrich.
It contains the comment, Galton does not explain why he uses the term
normal but the
I am running 64-bit Ubuntu 7.10 and unfortunately remember seeing that
error message but not how I got it to go away.
I would first try compiling netcdf-3.6.2 from source, without changing the
default directories for installation.
Looking at the error message it seems like the 3 shared
Dear Rolf,
One thing that sometimes makes nls easier to apply is using the 'formula'
argument like you would use the 'fn' argument of optim. That is, if you
have a residual function that has arguments x, y, a, b and you need to
optimize a and b, you would make a call like
', 'deviance' and 'residuals'
o The function 'nnnpls::nnnpls' allows each element of x to be
constrained to either a non-positive or a non-negative value
Katharine Mullen
mail: Department of Physics and Astronomy, Faculty of Sciences
Vrije Universiteit Amsterdam, de Boelelaan 1081
something like this sounds like what you want:
labs-NA
x-200
for(i in 1:5){ labs-append(labs, c(rep(NA,3),x)); x-x+200 }
plot(1:900, xaxt=n, xlim=c(0, 1000))
axis(side = 1, at = seq(0,1000,by=50), labels=labs)
On Fri, 30 Nov 2007 [EMAIL PROTECTED] wrote:
Hi Folks,
I'm advising someone who's
Almost every problem I have seen in the context of fitting mixtures of
exponentials/Gaussians has near-equal performance under LM or GN in terms
of iterations/evaluations to convergence and the SSE of the solution
found.
(However, very recently I have encountered a problem with a large number
of
Your calculations are done with a precision that depends on your machine.
I guess that you want to know how to _print_ more decimal digits.
See how many digits you print now with
getOption(digits)
Change this with, e.g.,
options(digits=12)
On Mon, 12 Nov 2007, raymond chiruka wrote:
hie
I can confirm this behavior on R-2.6.0 but don't have time to look into it
further at the moment.
On Mon, 12 Nov 2007, Joerg van den Hoff wrote:
I initially thought, this should better be posted to r-devel
but alas! no response. so I try it here. sory for the
lengthy explanation but
On about line 547 in nls.R there is
mf$formula - # replace by one-sided linear model formula
as.formula(paste(~, paste(varNames[varIndex], collapse = +)),
env = environment(formula))
If this is replaced with
mf$formula - # replace by one-sided linear model
bw.SJ calls C code from the file
/usr/local/bin/R-2.6.0/src/library/stats/src/bandwidths.c
You have to make this code available.
You can do the following:
1. copy bandwidths.c and the definition of bw.SJ (the latter renamed) to a
directory
2. compile bandwidths.c into a shared library with the
. of bw.SJ; add the argument PACKAGE=stats.
On Tue, 6 Nov 2007, Katharine Mullen wrote:
bw.SJ calls C code from the file
/usr/local/bin/R-2.6.0/src/library/stats/src/bandwidths.c
You have to make this code available.
You can do the following:
1. copy bandwidths.c and the definition of bw.SJ
If you are free to format your references to packages and functions as you
please, you might follow the convention used by the Journal of Statistical
Software.
you can do this by adding the following to your latex file:
\newcommand{\pkg}[1]{{\normalfont\fontseries{b}\selectfont #1}}
B is symmetric by definition; if it's also real positive-definite then A
is the upper triangular factor of the Choleski decomposition, and you can
use
chol(B)
to get A.
On Wed, 31 Oct 2007, Michael Gormley wrote:
Given a matrix B, where B=A'A, how can I find A?
In other words, if I have a
Regarding your first issue:
you could make a package to contain your function (see ?package.skeleton
and the manual Writing R extensions) - then you could use
library(yourpackagename). Or you could save the definition of your
function(s) in a text file, and use source(textfilename) to load the
sorry, just do rev on the columns (no t()):
x
[,1] [,2] [,3]
[1,]123
[2,]456
[3,]789
apply(x,2,rev)
[,1] [,2] [,3]
[1,]789
[2,]456
[3,]123
On Tue, 23 Oct 2007, Katharine Mullen wrote:
One way:
x-1:9
rev(x
Below is an example R - netCDF - R for rows of a dataframe that are
numeric vectors --note however that your dataframe includes character
vectors. I can't look into that case at the moment - maybe it's easy to
solve, or maybe you have to do some hashing.
## begin ex.
library(ncdf)
dat -
use sep=, e.g.,
paste(Laufwerk,Stadtwerksname,.csv,sep=)
On Wed, 17 Oct 2007 [EMAIL PROTECTED] wrote:
Hi there,
I've got the following problem under Windows XP, R 2.5.1:
When I'm pasting some objects:
Stadtwerksname-Mannheim
Laufwerk-C:\\
paste(Laufwerk,Stadtwerksname,.csv)
I get
. On request, I can
modify this behavior.
I would be interested in suggestions, bug reports, and other comments.
Kate Mullen
Katharine Mullen
mail: Department of Physics and Astronomy, Faculty of Sciences
Vrije Universiteit Amsterdam, de Boelelaan 1081
1081 HV Amsterdam, The Netherlands
room: T.1.06
Let me also comment that you are trying to interface to a function ported
to C++ from the Cephes library, which is in C. You have not explained why
you are trying to interface to the function (is this an exercise, or do
you suspect a problem with digamma()?), but if you just want access to it
as
have you tried the function image.plot in the package fields?
On Fri, 12 Oct 2007, zhijie zhang wrote:
Dear friends,
Anybody has ever met the problem to add a legend to a figure generated by
image()? I have three variables,x,y and z.
x and y are the coordinates, and z is the third values.
in case you are not aware: the function psi is available without a port;
see help(digamma).
On Wed, 10 Oct 2007, Bernardo Lagos Alvarez wrote:
Hi All,
Anybody know as run the function psi on
http://www.alglib.net/translator/dl/specialfunctions.psi.csharp.zip
or
Uwe Ligges seems to be providing a simple way to make the conversion
(though I have not used it):
http://win-builder.r-project.org/
On Mon, 1 Oct 2007, Edna Bell wrote:
Dear R Gurus;
Is there a simple way to convert a Linux produced tar.gz file (a
package) to a Windows binary zip package,
I would stress the advantages of the free and open source nature of R over
the proprietary programs you mention. Because R is free (as in beer), your
student will have access to it even when they are free of the university
that I presume buys a MATLAB/SPSS license for them. And because R is open
The source code for print.summary.lm and summary.lm is in the file
/src/library/stats/R/lm.R of the R source code, which you can download
from CRAN if you don't have it already. The file lm.R is also at
https://svn.r-project.org/R/trunk/src/library/stats/R/lm.R
On Fri, 28 Sep 2007, Sergey
have you seen help(strsplit)?
On Tue, 25 Sep 2007, lucy b wrote:
Dear List,
I have an ascii text file with data I'd like to extract. Example:
Year Built: 1873 Gross Building Area: 578 sq ft
Total Rooms: 6 Living Area: 578 sq ft
There is a lot of data I'd like to ignore in each
It is not clear from your post what changes per-group. If only the
starting values change (but the data and the model structure are the
same), then you can just store the starting values you want to use for
each group in a list, and then index into this list in your call to nls.
e.g., modifying
how about:
require(splines)
x-1:5
y - c(0.31, 0.45, 0.84, 0.43, 0.25)
yy -predict(interpSpline(x, y))
plot(x, y)
lines(yy)
Katharine Mullen
mail: Department of Physics and Astronomy, Faculty of Sciences
Vrije Universiteit Amsterdam, de Boelelaan 1081
1081 HV Amsterdam, The Netherlands
room
see ?plotmath
you want to use mu for micro, as in
plot(1:10, ylab = expression(paste(mu, M)))
On Thu, 13 Sep 2007, Zheng Lu wrote:
Dear all:
Is there any one could tell me how I can represent Micro-molar as an
unit of concentration when I plot with R(S-plus), I don't want write
'uM' from
74 matches
Mail list logo