search for: xstart

Displaying 20 results from an estimated 30 matches for "xstart".

Did you mean: start
2010 May 14
2
Subscripting a matrix-like object
...n calls of the form x[i] <- someValue and x[i,] <- someValue ? In either case, nargs() is 3, and looking at the values from sys.call() and match.call() I could not tell them apart. Am I missing something? "[<-.tis" <- function(x, i, j, ..., value){ tif <- tif(x) xStart <- start(x) x <- stripTis(x) if(missing(i)){ if(missing(j)) x[] <- value else x[,j] <- value } else { i <- i[!is.na(i)] if(is.numeric(i)){ if(!is.ti(i) && couldBeTi(i, tif = tif)) i <- asTi(i) if(is.ti(i)){ i...
2010 May 14
2
Subscripting a matrix-like object
...n calls of the form x[i] <- someValue and x[i,] <- someValue ? In either case, nargs() is 3, and looking at the values from sys.call() and match.call() I could not tell them apart. Am I missing something? "[<-.tis" <- function(x, i, j, ..., value){ tif <- tif(x) xStart <- start(x) x <- stripTis(x) if(missing(i)){ if(missing(j)) x[] <- value else x[,j] <- value } else { i <- i[!is.na(i)] if(is.numeric(i)){ if(!is.ti(i) && couldBeTi(i, tif = tif)) i <- asTi(i) if(is.ti(i)){ i...
2004 Jan 23
0
cmptl_analy.R
...One key is adjustment of nls optimizer tolerance. I notice it has to be higher than usual, but, I recovered your noisy "known" parameter values with an error of K1 (-7%) and k1 (-6%): #### Miller problem with Dalgaard modifications ## Linares 1/22/2004 ## Solution 1 nls(noisy ~ lsoda(xstart, time, one.compartment.model, c(K1=K1, k2=k2))[,2], data=C1.lsoda, start=list(K1=0.3, k2=0.7), control=nls.control(maxiter=50,tol=1), trace=T ) 0.3594355 : 0.3 0.7 0.006118908 : 0.3456684 0.3518834 0.002828044 : 0.4057868 0.4081200...
2006 Mar 26
2
Problem with names() in a plot after ordering a data.frame. Syntax or stupidity?
...the names match the sorted Area names(Area) <- rev(Pcode) Lines <- 1:numberProvs plot(sort(Area), Lines, pch=20, col="red", xlab = " Area", ylab= "Province or Territory", axes=F) axis( 2, at=Lines, labels=names(Area), las=1) axis (1, labels= T) xstart <- 0 xend <- Area ystart <- rev(Lines) yend <- rev(Lines) arrows(xstart, ystart, xend, yend, col="red", length = 0) # --------------End of Crude working program----------------------------- # --------------Revised program using order on the data.frame------------- provs &lt...
2011 Aug 20
4
[PATCH 1/2] Make xencommons a bit more idiomatic
...tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons Sat Aug 13 10:14:58 2011 +0100 +++ b/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 16:56:16 2011 -0700 @@ -29,11 +29,9 @@ XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid shopt -s extglob -if test "x$1" = xstart && \ - test -d /proc/xen && \ - ! test -f /proc/xen/capabilities && \ - ! grep ''^xenfs '' /proc/mounts >/dev/null; -then +if [ "x$1" = xstart -a -d /proc/xen -a \ + ! -f /proc/xen/capabilities ] && \ + ! grep -qw ''...
2012 Dec 04
1
Solve system of equations (nleqslv) only returns origin
...*(((1-exp(-2*D*v1*N1))*x[2])+K))))*(2*v1*N1*D)) + ((1-x[4])*(p2-(((theta+mu)*(((N2/A)*g2^greekp*x[1]^b2)+K))+((theta+mu)*(((1-exp(-2*D*v2*N2))*x[2])+K))))*(2*v2*N2*D)) - (delta1*theta*x[3]*(2*v1*N1*D)) - (delta2*theta*x[4]*(2*v2*N2*D)))-Cs*((2*v1*N1*D)+(2*v2*N2*D))) result=(x) } Xstart=c(10000, 200, 0.5, 0.5, 12) fstart= firstordercond(Xstart) nleqslv(Xstart, firstordercond) -- Alicia Ellis Postdoc Gund Institute for Ecological Economics University of Vermont 617 Main Street Burlington, VT 05405 (802) 656-1046 http://www.uvm.edu/~aellis5/ <http://entomology.ucdavis.edu/f...
2010 Sep 20
1
ERROR: Object not found
...switch <- 0 } dP1 <- a+b*P1-switch*P1 dP2 <- a-b*P1+switch*P2 list(c(dP1,dP2,dIN)) }) } # Parameters a <- 0.1 b <- 0.2 c <- 0.5 parms <- c(a=a,b=b,c=c) # Initial conditions P10 <- 100.0 P20 <- 0.0 IN0 <- 0.0 xstart <- c(P1=P10,P2=P20,IN=IN0) # Time points times <- seq(0,10,by=1) out <- as.data.frame(rk4(xstart,times,ode,parms)) [[alternative HTML version deleted]]
2010 Sep 20
1
Ask for help with Error: Object not found
...switch <- 0 } dP1 <- a+b*P1-switch*P1 dP2 <- a-b*P1+switch*P2 list(c(dP1,dP2,dIN)) }) } # Parameters a <- 0.1 b <- 0.2 c <- 0.5 parms <- c(a=a,b=b,c=c) # Initial conditions P10 <- 100.0 P20 <- 0.0 IN0 <- 0.0 xstart <- c(P1=P10,P2=P20,IN=IN0) # Time points times <- seq(0,10,by=1) out <- as.data.frame(rk4(xstart,times,ode,parms)) [[alternative HTML version deleted]]
2011 Aug 20
3
[PATCH 2/2] Load gntdev and evtchn if they''re modular.
...2 tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 16:56:16 2011 -0700 +++ b/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 17:05:18 2011 -0700 @@ -29,12 +29,18 @@ XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid shopt -s extglob -if [ "x$1" = xstart -a -d /proc/xen -a \ - ! -f /proc/xen/capabilities ] && \ - ! grep -qw ''^xenfs'' /proc/mounts; then - mount -t xenfs xenfs /proc/xen +[ -d /proc/xen ] || exit 0 # Xen not present; exit quietly + +if [ "x$1" = xstart ]; then + # Mount /proc/xen if needed + [...
2010 Mar 11
4
help about solving two equations
I have two matrix s1 and s2, each of them is 1000*1. and I have two equations: digamma(p)-digamma(p+q)=s1, digamma(q)-digamma(p+q)=s2, and I want to sovle these two equations to get the value of x and y, which are also two 1000*1 matrices. I write a program like this: f <- function(x) { p<- x[1]; q <- x[2]; ((digamma(p)-digamma(p+q)-s1[2,]) )^2 +((digamma(q)-digamma(p+q)-s2[2,]) )^2
2004 Jan 22
4
Fitting compartmental model with nls and lsoda?
Dear Colleagues, Our group is also working on implementing the use of R for pharmacokinetic compartmental analysis. Perhaps I have missed something, but > fit <- nls(noisy ~ lsoda(xstart, time, one.compartment.model, c(K1=0.5, k2=0.5)), + data=C1.lsoda, + start=list(K1=0.3, k2=0.7), + trace=T + ) Error in eval(as.name(varName), data) : Object "C1.lsoda" not found What part of the e-mail did I miss? I would like to get this prob...
2017 Jun 12
2
Possible with enableJIT function
...eproduce the continuously increasing memory usage with the following small example. <code> library(nleqslv,lib.loc="../nleqslv.Rcheck") library(pryr) dslnex <- function(x) { y <- numeric(2) y[1] <- x[1]^2 + x[2]^2 - 2 y[2] <- exp(x[1]-1) + x[2]^3 - 2 y } xstart <- c(x1=1.5,x2=2) nsims <- 10 for(test_iter in seq_len(nsims)){ z <- nleqslv(xstart,dslnex,jacobian=NULL) print(paste("nleqslv iteration",test_iter,"and memory used is",mem_used())) } memory.profile() gc() print(paste("At end memory used is", mem_used(...
2003 Oct 23
2
OOP like handling of lists?
...model<-list( equations = function(t, x, p) { dx1.dt <- p["k1"] * x[1] - p["k2"] * x[1] * x[2] dx2.dt <- - p["k3"] * x[2] + p["k2"] * x[1] * x[2] list(c(dx1.dt, dx2.dt)) }, parms = c(k1=0.2, k2=0.2, k3=0.2), xstart = c(prey=0.5, predator=1) # and some more elements ... ) class(lvmodel) <- "odemodel" ## Getting and setting parameters ################################### getParms <- function(model) { model$parms } setParms <- function(model, parmlist) { for (i in 1:length(parmlis...
2010 Apr 06
1
estimating the starting value within a ODE using nls and lsoda
...1,9.9,9.8,12.1,10.7,11.1,11.5,11.2,10.3,171.0,179.0,145.6,147.0,105.0,20.2,15.3,14.7,12.3,10.4,7.7,7.0,7.5,4.9,5.6,5.8) time <- c(0,1,3,4,6,7,8,10,12,14,16,19,22,23,24,25,27,40,50,60,70,80,90,100,120,140,160,180) G_b <- 100 I_b <- 5.8 parms <- c(p1=0.012584, p2=0.037708, p3=0.000012524) xstart <- c(G=273.92,X=0) sim.data <- as.data.frame(rk4(y=xstart, time=time, func=minmod, parms=parms)) # note: i use rk4 because the standard software for estimating this model uses a Runge-Kutta approach sim.data$noisy <- sim.data$G + rnorm(nrow(sim.data), mean=0, sd=0.01*sim.data$G) ###### e...
2008 Apr 25
5
Non-linear system of equations
Hello R users, I am trying to estimate the parameters of a bimodal normal distribution using moments matching, so I have to solve a non-linear system of equations. How can I solve the following simple example? x^2 - y^2 = 6 x ? y = 3 I heard about nlsystemfit, but I don?t know how to run it exactly. I have tried the following code, but it doesn?t really work: f1 <-y~ x[1]^2-x[2]^2-6 f2
2005 Jul 27
4
odesolve/lsoda differences on Windows and Mac
...Machine Model: Power Mac G5 CPU Type: PowerPC 970 (2.2) Number Of CPUs: 2 CPU Speed: 2 GHz L2 Cache (per CPU): 512 KB Memory: 1.5 GB Bus Speed: 1 GHz Boot ROM Version: 5.0.7f0 Serial Number: XB3472Q1NVS My Error Message > system.time( + outAc2 <- as.data.frame(lsoda(xstart,times, pondamph, parms, tcrit=170*730, hmin=.1)) + ) [1] 0.02 0.01 0.04 0.00 0.00 Warning messages: 1: lsoda-- at t (=r1) and step size h (=r2), the 2: corrector convergence failed repeatedly 3: or with abs(h) = hmin 4: Returning early from lsoda. Results are accurate, as far as they...
2007 May 30
0
Help me understand colours on linux
...ase packages: [1] "methods" "stats" "graphics" "grDevices" "utils" "datasets" [7] "base" I have a function that is trying to draw rectangles using 136 different colours, and I get the following error: Error in rect(xstart, my.min, xstart + fcount[i, 2], my.max, col = fcolors[i], : Error: X11 cannot allocate additional graphics colours. Consider using X11 with colortype="pseudo.cube" or "gray". However, if I use "pseudo.cube" I don't get anywhere near enough distinct colou...
2011 Feb 23
1
ggplot2 directional line type?
I'm doing a path plot with ggplot2, the result is looking very nice, but I want to give some indication of which direction the lines are going. I thought of using colour gradients, but it doesn't look right. What would be ideal is a line type that indicated direction, something like ">>>>>>>". Is there any way to achieve this? Or can anyone suggest another
2009 Dec 22
1
RGtk2 - retrieve ggraphics mouse coordinates during drag-and-drop event
...t;usr") c( (usr[2]-usr[1])/(plt[2]-plt[1])*(x - plt[1]) + usr[1], (usr[4] - usr[3])/(plt[4] - plt[3])*(y - plt[3]) + usr[3]) } addHandlerFocus(g, handler = function(h,...) { print(c("focus g")) }) addHandlerClicked(g, handler = function(h,...) { x <- h$x; y <- h$y xStart <<- x; yStart <<- y pressed <<- TRUE print(c("pressed at:", c(x,y))) }) da <- g at widget@widget callbackID <- gSignalConnect(da,"button-release-event", function (w,e,...) { allocation = w$GetAllocation() xclick = e$GetX() yclick = e$GetY() x...
2017 Jun 13
0
Possible with enableJIT function
...with the following small example. > > <code> > library(nleqslv,lib.loc="../nleqslv.Rcheck") > library(pryr) > dslnex <- function(x) { > y <- numeric(2) > y[1] <- x[1]^2 + x[2]^2 - 2 > y[2] <- exp(x[1]-1) + x[2]^3 - 2 > y > } > xstart <- c(x1=1.5,x2=2) > nsims <- 10 > for(test_iter in seq_len(nsims)){ > z <- nleqslv(xstart,dslnex,jacobian=NULL) > print(paste("nleqslv iteration",test_iter,"and memory used is",mem_used())) > } > memory.profile() > gc() > print(paste("...