search for: pars2

Displaying 4 results from an estimated 4 matches for "pars2".

Did you mean: parse
2009 Dec 06
2
Error in eval(expr, envir, enclos) : object 'N' not found
...nction(t, state, pars) { with (as.list(c(state, pars)), { dT=(a*T-a*T*b*T) - (c1*N*T) - (Kt*M*T) dN=a1 - (f*N) + g * (T/(h+T)) * N - (p * N * T) - (Kn * M * N) dC=a2 - (beta * C) - (Kc * M * C) dM= -(gamma) * M + Vm return(list(c(dT,dN,dC,dM))) }) } model2 <- function(t, state2, pars2) { with (as.list(c(state2, pars2)), { dT=(a*T-a*T*b*T) - (c1*N*T) - (Kt*M*T) dN=a1 - (f*N) + g * (T/(h+T)) * N - (p * N * T) - (Kn * M * N) dC=a2 - (beta * C) - (Kc * M * C) dM= -(gamma) * M + Vm return(list(c(dT,dN,dC,dM))) }) } ### First Half - Tumor growth to 10% pars <- list...
2002 Dec 12
0
if problem in function
...function(datamat, tradhogst=c("trad", "h?gst")) { # first pick out correct parameter sets. They depend on tree species # if tree speciec is bjork (birch) -> choose bjork.formh?jd.pars # and bjork.h?jd.pars as pars1 and pars2, respectively # if(datamat$tree.spec == "Bj?rk") { pars1<- bj?rk.formh?jd.pars pars2<- bj?rk.h?jd.pars } # if tree species is pine... if( datamat$tree...
2010 Oct 21
1
gam plots and seWithMean
...frame(t,d,x1,x2,x3) datn<-transform(dat,d=0) dif<-predict(f2)-predict(f2,datn) cdif<-dif-mean(dif) points(d,cdif,cex=0.5,col=rgb(0,1,0,0.2)) #another approach to the solid line s(d) devAskNewPage(ask=T) plot(f2) premat2<-PredictMat(f2$smooth[[1]],data=dat) dim(premat2) pars<-f2$coef pars2<-pars[5:13] pars2<-as.matrix(pars2,9,1) pars2 points(d,premat2%*%pars2,cex=0.5,col=rgb(0,0.6,0.3,0.2)) #premat2%*%pars2 = cdif #confidence intervals when seWithMean = FALSE devAskNewPage(ask=T) plot(f2) points(d,cdif,cex=0.5,col=rgb(0,1,0,0.2)) Vp2<-f2$Vp[5:13,5:13] se2<-sqrt(diag(prem...
2008 Jan 22
2
R object as a function
I want to use a function as an argument to ingtegrate it twice. See the following (senseless) example of a double integration: test<-function(sf,lo,up,rest) { innerFkn<-function(sf,lo) { inte=integrate(f=sf,lower=lo,upper=4) return( inte$value ) } integral=integrate(f=innerFkn,lower=1,upper=2,sf=sf,lo=lo,up=up) return( integral$vlaue+rest ) }