[R] Questions about permutation tests and error when using clusterCall (snow package)

2015-05-12 Thread Adam Zeilinger
# Fit LME model lmeResults <- anova(lme(randomLambda ~ year*region*crop, data = data, random = list(site = ~1|year:region))) return(lmeResults) } # Call to cluster with replicate() function rtoutCluster <- clusterCall(cl, function(n.iter = 100) replicate(n.iter, randTest(data), s

[R] Installing rgdal and rjags packages on a linux cluster

2014-07-09 Thread Adam Zeilinger
ing that I need to install PROJ.4 libraries and the developer versions of the rgdal and proj4 packages. Is this correct? Are the problems with installing rjags and rgdal basically the same? Could the problems be caused by running an older version of R? Any help would be greatly appre

Re: [R] problem with convergence in mle2/optim function

2012-12-02 Thread Adam Zeilinger
y[,2] n2 <- y[,3] n3 <- y[,4] gr.p1 <- gr.p2 <- gr.mu1 <- gr.mu2 <- gr.mat <- matrix(c(gr.p1, gr.p2, gr.mu1, gr.mu2), ncol = 4) -colSums(gr.mat) } I verified this gradient function with numerical approximation with the grad() function [numDeriv packag

Re: [R] model selection with spg and AIC (or, convert list to fitted model object)

2012-12-02 Thread Adam Zeilinger
rameter is on the boundary (mu1 = 0.0001) # Augmented Lagrangian optimization hin <- function(x){ h <- rep(NA, 4) h[1] <- 0.0001 + x[1] h[2] <- 0.0001 + x[2] h[3] <- 0.0001 + x[3] h[4] <- 0.0001 + x[4] h } lag.op <- auglag(par = c(0.1, 0.1, 0.1, 0.1),

[R] model selection with spg and AIC (or, convert list to fitted model object)

2012-10-10 Thread Adam Zeilinger
control = list(maxit = 5000, trace = FALSE)) spg2 <- spg(par = c(2, 0.001), fn = NLL2, y = y, lower = c(0.0001, 0.0001), control = list(maxit = 5000, trace = FALSE)) # Model selection with ICtab; currently gives an error ICtab(spg1, spg2) ######

Re: [R] problem with convergence in mle2/optim function

2012-10-09 Thread Adam Zeilinger
tion, I get an error that the gradient function is incorrect. Does anyone have any suggestions on how to write my gradient function? Am I calculating the gradient equation, gr.p1 incorrectly? As always, any help would be much appreciated. Adam Zeilinger On 10/8/2012 3:44 AM, Berend Hasselma

Re: [R] problem with convergence in mle2/optim function

2012-10-07 Thread Adam Zeilinger
o eliminate t from the exponential terms. Does anyone have any suggestions on how to address this problem? Perhaps there is a way to bound p1, p2, mu1, and mu2 to avoid the exponential terms going to infinity? Or bound P1 and P2? Any suggestions would be greatly appreciated. Adam Zeilinger

[R] problem with convergence in mle2/optim function

2012-10-04 Thread Adam Zeilinger
t I need to supply values for t, n1, n2, and n3 to the gradient function, which are from the dataset yt, above. When I supply the dataset yt, the function produces a vector of length 4*nrow(yt) = 80. When I include it in my mle2() function, I get an error that ml

[R] problems with mle2 convergence and with writing gradient function

2012-09-27 Thread Adam Zeilinger
on is: grr <- function(p1, p2, mu1, mu2, y){ t <- y[,1] n1 <- y[,2] n2 <- y[,3] n3 <- y[,4] c(gr.p1, gr.p2, gr.mu1, gr.mu2) } The problem is that I need to supply values for t, n1, n2, and n3 to the gradient function, which are from the dataset yt, above. This functio

Re: [R] perform multiple regression with loop

2012-05-08 Thread Adam Zeilinger
sor, Windsor, Canada > > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting g

Re: [R] Using apply() with a function involving ode()

2012-04-25 Thread Adam Zeilinger
tion works perfectly. Sincerely, Adam On 4/25/2012 2:02 AM, Berend Hasselman wrote: See inline comments. On 25-04-2012, at 08:40, Adam Zeilinger wrote: Hello, I am trying to get the output from the numerical simulation of a system of ordinary differential equations for a range of values for thre

[R] Using apply() with a function involving ode()

2012-04-24 Thread Adam Zeilinger
the apply() function returns an error: Error in eval(expr, envir, enclos) : object 'alphaB' not found I am not sure what is wrong. Any help would be much appreciated. Sincerely, Adam -- Adam Zeilinger Post Doctoral Scholar Department of Ento

Re: [R] eigenvalues of matrices of partial derivatives with ryacas

2012-03-16 Thread Adam Zeilinger
problem might be and how to troubleshoot it? Thanks again for your help! Adam On 3/15/2012 5:16 PM, Gabor Grothendieck wrote: On Thu, Mar 15, 2012 at 7:51 PM, Adam Zeilinger wrote: Hello, I am trying to construct two matrices, F and V, composed of partial derivatives and then find the e

[R] eigenvalues of matrices of partial derivatives with ryacas

2012-03-15 Thread Adam Zeilinger
" : bad argument number 1 (counting from 1)The offending argument $ii49<= $nr49 evaluated to Not Length-1<0CommandLine(1) : Invalid argument According to Mathematica, the correct eigenvalues are: {-((Sqrt[betah] Sqrt[betav] Sqrt[Sh] Sqrt[Sv])/Sqrt[gamma muv + muh muv]), (Sqrt[betah

Re: [R] simultaneously maximizing two independent log likelihood functions using mle2

2011-11-18 Thread Adam Zeilinger
using a similar approach when maximizing my function as I've described with the DBH example. Any help would be much appreciated. Adam Zeilinger On 10/17/2011 5:47 AM, Ben Bolker wrote: Adam Zeilinger umn.edu> writes: I have a log likelihood function that I was able to optimize usi

[R] simultaneously maximizing two independent log likelihood functions using mle2

2011-10-16 Thread Adam Zeilinger
years are different. Perhaps an important difference from the above example is that I am using a multinomial distribution (dmnom) because my data are trinomially distributed. Any help would be greatly appreciated. Adam Zeilinger -- Adam Zeilinger Ph. D Candidate Conservation Biology Program Uni

Re: [R] Suppressing error messages printed in xyplot() with panel function

2011-08-24 Thread Adam Zeilinger
Dear Deepayan and Dennis, Both of your proposed fixes worked perfectly. Thank you! Adam On 8/24/2011 9:47 PM, Deepayan Sarkar wrote: On Thu, Aug 25, 2011 at 1:00 AM, Adam Zeilinger wrote: Hello, I am using the xyplot() function to create a series of scatterplot panels with lines of best

[R] Suppressing error messages printed in xyplot() with panel function

2011-08-24 Thread Adam Zeilinger
ls, an error message is printed in the panel, something like: "Error using packet 4 missing value where TRUE/FALSE needed." In the panels with error messages, I want to keep the panels but suppress the error message, such that the panel is blank or has only one datum. How do I