Displaying 20 results from an estimated 70000 matches similar to: "no implicit call of the print function within loops?"
2002 Jun 20
1
Bug in printing symbolic derivative (PR#1697)
A colleague pointed out the following error in D():
f <- expression(exp(-2*x*y))
Dx <- D(f, 'x')
Dy <- D(f,'y')
Dxy <- D(Dx, 'y')
Dyx <- D(Dy, 'x')
Then
> Dx # this is right
-exp(-2 * x * y) * (2 * y)
> Dy # this is right
exp(-2 * x * y) * (-2 * x)
> Dxy # this is wrong in the sign of the second term!!!
-exp(-2 * x * y) *
2008 Sep 27
1
seg.fault from nlme::gnls() {was "[R-sig-ME] GNLS Crash"}
>>>>> "VW" == Viechtbauer Wolfgang (STAT) <Wolfgang.Viechtbauer at STAT.unimaas.nl>
>>>>> on Fri, 26 Sep 2008 18:00:19 +0200 writes:
VW> Hi all, I'm trying to fit a marginal (longitudinal)
VW> model with an exponential serial correlation function to
VW> the Orange tree data set. However, R crashes frequently
VW>
2007 Sep 10
2
Are the error messages of ConstrOptim() consisten with each other?
Dear Friends.
I found something very puzzling with constOptim(). When I change the
parameters for ConstrOptim, the error messages do not seem to be
consistent with each other:
> constrOptim(c(0.5,0.3,0.5), f=fit.error, gr=fit.error.grr, ui=ui,ci=ci)
Error in constrOptim(c(0.5, 0.3, 0.5), f = fit.error, gr = fit.error.grr, :
initial value not feasible
> constrOptim(c(0.5,0.9,0.5),
2012 Oct 05
2
problem with convergence in mle2/optim function
Hello R Help,
I am trying solve an MLE convergence problem: I would like to estimate
four parameters, p1, p2, mu1, mu2, which relate to the probabilities,
P1, P2, P3, of a multinomial (trinomial) distribution. I am using the
mle2() function and feeding it a time series dataset composed of four
columns: time point, number of successes in category 1, number of
successes in category 2, and
2006 Feb 12
1
lme, nlsList, nlsList.selfStart
Dear listers,
I am trying to fit a model using nlsList() using alternately a SSfol()
selfstart function or its developped equivalent formulae.
This preliminary trial works well
mydata<-groupedData(Conc~Tps|Organ,data=mydata)
mymod1<-nls(Conc~SSfol(Dose,Tps,lKe,lKa,lCl),data=mydata)
as well as a developped form:
mymod2<-nls(Conc~Dose * exp(lKe+lKa-lCl) *
2006 Aug 14
1
Help with workaround for: Function '`[`' is not in the derivatives table
# This works fine:
> a <- 1
> b <- 2
> c <- 3
> E <- expression(a * exp(b*X) + c)
> X <- c(0.5, 1.0, 2.0)
> eval(E)
[1] 5.718282 10.389056 57.598150
> D(E, "b")
a * (exp(b * X) * X)
> eval(D(E, "b"))
[1] 1.359141 7.389056 109.196300
# But if (a,b,c) are replaced with (A[1], A[2], A[3]), how can I get a
derivative
2007 Oct 24
1
Error in nls model.frame
Error in model.frame
When I run the following nls model an error message appears and I dont
know how to solve that. Could you help me??
mat = c(1,2,3,4,5,6,7,8,9,12,16,24,36,48,60)
for (i in 1:length(j30)) {
bliss = nls(c(j[i,1:length(mat)]) ~ b0 + b1*((1-exp(-k1*mat))/(k1*mat)) +
b2*(((1-exp(-k2*mat))/(k2*mat))-exp(-k2*mat)),
start = list(k1=0.1993, k2=0.1993, b0= 22.0046,
2009 Dec 01
1
Adding and Multiplying two Unevaluated Expressions
HI,
As I'm trying to compute Taylor series, I'm having problems in adding and multiplying unevaluated expressions. I searched for a solution but found none.
my Taylor function works fine for evaluating functions as you can see here:
rTaylorVal=function(exp,x0,dx,n) {
ls=list(x=x0)
newexp=eval(exp,ls)
exp0=exp
for (i in 1:n){
exp0=D(exp0,"x")
2007 Jan 12
1
incorrect result of deriv (PR#9449)
Full_Name: Joerg Polzehl
Version: 2.3.1
OS: x86_64, linux-gnu
Submission from: (NULL) (62.141.176.22)
I observed an incorrect behavior of function deriv when evaluating arguments of
dnorm
deriv(~dnorm(z,0,s),"z")
expression({
.value <- dnorm(z, 0, s)
.grad <- array(0, c(length(.value), 1), list(NULL, c("z")))
.grad[, "z"] <- -(z * dnorm(z))
2003 Jan 29
2
substitute, eval and hastables
I have the following problem. I have an automatically generated named
list with "stringified" names:
a <- list("A"=..., "B"=..., "C"=..., )
then I want to refer to the elements of the list, stored as an vector
of names:
nn <- c("A", "B", "C"), so that I could get list elements like
a$nn[1], a$nn[2], etc. Obviously it
2012 Jul 03
1
nls problem
hi list,
used versions: 2.12.1 and 2.14.0 under ubuntu and macosx.
I recently stumbled over a problem with `nls', which occurs if the model
is not specified explicitly but via an evaluation of a 'call' object.
simple example:
8<--------------------------------------------------------------------------------------
nlsProblem <- function (len = 5) {
2010 Feb 14
3
evaluate variable within expression - how?
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt.
Name: nicht verf?gbar
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100214/4b41a017/attachment.pl>
2005 Oct 07
3
Converting PROC NLMIXED code to NLME
Hi,
I am trying to convert the following NLMIXED code to NLME, but am
running into problems concerning 'Singularity in backsolve'. As I am new
to R/S-Plus, I thought I may be missing something in the NLME code.
NLMIXED
***********
proc nlmixed data=kidney.kidney;
parms delta=0.03 gamma=1.1 b1=-0.003 b2=-1.2 b3=0.09 b4=0.35 b5=-1.43
varu=0.5;
eta=b1*age+b2*sex+b3*gn+b4*an+b5*pkn+u;
2008 Dec 29
4
Merge or combine data frames with missing columns
Hi R-experts,
suppose I have a list with containing data frame elements:
[[1]]
(Intercept) y1 y2 y3 y4
-6.64 0.761 0.383 0.775 0.163
[[2]]
(Intercept) y2 y3
-3.858 0.854 0.834
Now I want to put them into ONE dataframe like this:
(Intercept) y1
2006 Jun 13
1
plotting gaussian data
Ok I guess it's time to ask.
So I want to plot my data. It's my data from a frequency table, "temp". My
formula is just a Gaussian eq. I have done the nls function to get my
parameters and now I want to do the whole plot (...) and then lines(..)
This is what I have done.
> temp
bin x
1 -4.0 0
2 -3.9 0
3 -3.8 0
4 -3.7 0
5 -3.6 0
6 -3.5 0 .... and so
2006 May 23
2
nls: formula error?
So thanks for the help,
I have a matrix (AB) which in the first column has my bin numbers so -4 - +4
in 0.1 bin units. Then I have in the second column the frequency from some
data. I have plotted them and they look roughly Gaussian. So I want to fit
them/ find/optimize "mu", "sigma", and "A".
So I call the nls function :
nls_AB <- nls(x ~ (A/sig*sqrt(2*pi))*
2011 Apr 20
2
survexp with weights
Hello,
I probably have a syntax error in trying to generate an expected
survival curve from a weighted cox model, but I can't see it. I used
the help sample code to generate a weighted model, with the addition
of a "weights=albumin" argument (I only chose albumin because it had
no missing values, not because of any real relevance). Below are my
code with the resulting error
2003 Feb 01
1
Trouble with optim
I am having trouble with optim. It claims to have converged to a minimum,
yet it has in the course of the optimization visited many points which are
closer to optimal. I would be grateful for any explanation of this
behaviour.
I'm trying to estimate the parameters in the model
X ~ Binomial(1,p) * NegBin(mu,theta).
So I define a log likelihood function, and invoke optim thus:
o <- optim
2001 May 30
2
environments
I would like to be able, inside a function, to create a new function, and
use it as part of a formula as an argument to, say, gnls or nlme. for
example:
MyTop <- function(data=dta) {
Cexp <- function(dose,A,B,m){...}
Model <- as.formula(paste("y","~ Cexp(",paste(formals(Cexp),collapse
=", "),")"))
MyCall <-
2005 Aug 03
1
passing variable to formula environment
List gurus,
I'm trying to code a Gompertz growth curve function as part of a larger
project and have run across a problem due to my ignorance of
environments. Some sample data and the function are as follows:
growth <- data.frame(age = c(1.92, 3, 5.83, 3.17, 15.5, 1.17, 5.58,
13.33, 14.29, 5.83, 13.79, 6.33, 13.75, 16.83, 13, 11.67, 0.25, 1.73,
9.46, 5.67), length = c(157, 165, 179,