search for: th1

Displaying 19 results from an estimated 19 matches for "th1".

Did you mean: eth1
2006 Nov 21
2
Symbolic derivation using D in package stats - how do I properly convert the returned call into a character string?
...numerical operation, e.g. c = a / b where both a and b are symbolic expressions and I wish for c to be a symbolic expression as well? Take e.g. the following example: #--------------------------------- # First, I try with d=2, now it works: d<-2; u<-rep("u1",d); th<-rep("th1",d) for(i in 1:d) { u[i] <- paste("u",i,sep=""); th[i] <- paste("th",i,sep="") } dC1 <- expression((((1 - 2 + u1^(-th1)) + u2^(-th1))^(-1/th1))) dC2 <- expression(u1) #These expressions were returned from a combination of several expressions...
2007 Jun 20
1
nlme correlated random effects
I am examining the following nlme model. asymporig<-function(x,th1,th2)th1*(1-exp(-exp(th2)*x)) mod1<-nlme(fa20~(ah*habdiv+ad*log(d)+ads*ds+ads2*ds2+at*trout)+asymporig(da.p,th1,th2), fixed=ah+ad+ads+ads2+at+th1+th2~1, random=th1+th2~1, start=c(ah=.9124,ad=.9252,ads=.5,ads2=-.1,at=-1,th1=2.842,th2=-6.917), data=pca1.grouped) However, the two ra...
2005 Oct 12
0
Model parameterization / Factor Levels
Dear R users; I'm looking for some hint about how to deal with the following situation: Response = Y Factor A = levels: 0, 1 Factor B = levels: 0, 1 Factor C = levels: 1,2,3,4 Model: Logistic 3-parms. where th1~1+A+C, th2~1+C; th3~1 For 'simplicity' (for me) I'm using the SAS contrast parameterization. The output looks like Beta p-value th1.(Intercept) 550 <0.000 th1.A1 -15 <0.000 th1.B1 5 <0.032 th1.C1 -12 <0.001 th1.C2 -5 0.022 th1.C3 -3 0.222 th2.(Intercept) .........
2007 Jul 18
0
multicollinearity in nlme models
I am working on a nlme model that has multiple fixed effects (linear and nonlinear) with a nonlinear (asymptotic) random effect. asymporig<-function(x,th1,th2)th1*(1-exp(-exp(th2)*x)) asymporigb<-function(x,th1b,th2b)th1b*(1-exp(-exp(th2b)*x)) mod.vol.nlme<-nlme(fa20~(ah*habdiv+ads*ds+ads2*ds2+at*trout)+asymporig(da.p,th1,th2)+ asymporigb(vol,th1b,th2b), fixed=ah+ads+ads2+at+th1+th2+th1b+th2b~1, random=pdBlocked(list(th1~1,th2~1)),...
2003 Mar 17
1
help with likelihood contour plot
Can some kind person point out my error here? I'm trying to set up a grid for a countour plot of a likelihood function. > u <- rnorm(20,9.5,2.5) > # sample of size 20 from N(9.5,2.5^2) > loglik <- function(th1,th2) { + n <- length(u) + -(n/2)*log(2*pi*th2^2)-0.5*sum((u-th1)^2/th2^2) + } > x <- seq(4.5,14.5,len=50) > y <- seq(0.5,6,len=50) > f <- outer(x, y, loglik(x,y)) Error in match.fun(FUN) : not function, character, or symbol: "loglik(x, y)" In addition: Warning mess...
2004 Mar 19
2
(no subject)
How to use "contour" function? I type "contour(th1,th2,SumofSquares,levels=c(seq(1000,4000,200)))" But I didn't see contour in the plot, I guess it is because my data is so big that contour is out of range. Does anybody know how to fix this problem? here th1 is a 1x101 array(158741.8-298529.6) th2 is another 1X101 array(-0.0058352269-0...
2005 Nov 16
2
Newton-Raphson
Dear all, I want to solve a score function by using Newton-Raphson algorithm. Is there such a fucntion in R? I know there's one called optim, but it seems only doing minimizing or maximizing. Thanks, Jimmy
2009 May 19
2
About " Error: C stack usage is too close to the limit"
...OTECT(tmp = mkString("{print(lh)}")); PROTECT(e = R_ParseVector(tmp, 1, &status, R_NilValue)); PrintValue(e); R_tryEval(VECTOR_ELT(e,0), R_GlobalEnv, &hadError); UNPROTECT(2); end_R(); } int main(int argc, char *argv[]){ pthread_t th1; int iret1; iret1 = pthread_create(&th1, NULL, ts_thread,NULL); pthread_join(th1, NULL); printf("Thread 1 return:%d\n", iret1); return 0; } ----------------------------------- 2, My os and compiler is: ----------------------------------- Linux debian 2.6....
2004 Dec 16
2
partial linear model
Dear all, Are there any packages can estimate the partial linear model. Or any one can give me any suggestions. Many thanks in advance. Jin
2009 May 18
0
About " Error: C stack usage is too close to the limit"
...OTECT(tmp = mkString("{print(lh)}")); PROTECT(e = R_ParseVector(tmp, 1, &status, R_NilValue)); PrintValue(e); R_tryEval(VECTOR_ELT(e,0), R_GlobalEnv, &hadError); UNPROTECT(2); end_R(); } int main(int argc, char *argv[]){ pthread_t th1; int iret1; iret1 = pthread_create(&th1, NULL, ts_thread,NULL); pthread_join(th1, NULL); printf("Thread 1 return:%d\n", iret1); return 0; } ----------------------------------- 2, My os and compiler is: ----------------------------------- Linux debian 2.6....
2009 May 19
0
About " Error: C stack usage is too close to the limit"--resend
...OTECT(tmp = mkString("{print(lh)}")); PROTECT(e = R_ParseVector(tmp, 1, &status, R_NilValue)); PrintValue(e); R_tryEval(VECTOR_ELT(e,0), R_GlobalEnv, &hadError); UNPROTECT(2); end_R(); } int main(int argc, char *argv[]){ pthread_t th1; int iret1; iret1 = pthread_create(&th1, NULL, ts_thread,NULL); pthread_join(th1, NULL); printf("Thread 1 return:%d\n", iret1); return 0; } ----------------------------------- 2, My os and compiler is: ----------------------------------- Linux debian 2.6....
2007 Jul 07
3
color scale in rgl plots
...for what I want but I don't know how to take that palette and pick a color from it based on the value of X for a given data point. I'm fairly new to R and any suggestions would be greatly appreciated. Here's what I do - it's how to do the color mapping that has me stumped. plot3d(th1,ph,th2,type='s',size=wd1,col=????(rp1,0,0,1),cex=2,ylab=NULL,xlab=NULL,zlab=NULL,xlim=c(0,1),ylim=c(0,2),zlim=c(0,1),box=TRUE,axes=FALSE) I have also tried the more obvious col = rgb(a,b,c,d) where a,b,c,d are functions of X but I can't manage to come up with a nice looking color scale...
2008 Dec 04
0
integration within maximum likelihood
...ime. I'm no sure. I would appreciate any kind of help. Below is my code and the error report. Thanks Angelo > setwd("C:/Users/Angelo/Documents/PhD/Montecarlo TVI") > DATA<-read.table("Data.csv",header=TRUE,sep=",") > mnl.lik<-function(theta,y){ + th1<-theta[1] + th2<-theta[2] + tha<-theta[3] + thb<-theta[4] + thc<-theta[5] + thp<-theta[6] + thmu<-theta[7] + alfz<-theta[8] + alfp<-theta[9] + mu1<- alfz*y$z_a1 + alfp*y$p1 + mu2<- alfz*y$z_a2 + alfp*y$p2 + mu3<- alfz*y$z_a3 + alfp*y$p3 + U1<- th1 +tha*y$a1 +t...
2009 Mar 23
0
Problems with adapt
...o R so I would appreciate any comment on my code below. Thanks Angelo ---------------------------------------------------------------------------------------------------------- DATA<-read.table("Data.csv",header=TRUE,sep=",") library(adapt) mnl.lik<-function(theta,y){ th1<-theta[1] th2<-theta[2] tha<-theta[3] thb<-theta[4] thc<-theta[5] thp<-theta[6] thmu<-theta[7] alfz1<-theta[8] alfz2<-theta[9] alfc<-theta[10] alf<-theta[11] r<- 1 s<- 1 n<-2000 lik<-numeric(n) int<-numeric(n) v<- numeric(2) for (i in 1:n) { #Beg...
2009 May 22
1
Forcing a variableinto a model using stepAIC
...S can be used to do this but my SAS coding is poor and consequently it would be easier for me to use R, especially given the fractional polynomial transformations! Currently the model is as follows (without treatment). coxfita=coxph(Surv(rem.Remtime,rem.Rcens)~sind(nearma)+fsh(nearma)+fdr(nearma)+th1(nearma)+th2(nearma)+fp(cage)+fp(fint)+fp(tsb)+strata(rpa),data=nearma) Thank you for your help, Laura
2003 Oct 16
2
Interpolation of azimuth values
Hello I will make an interpolation of data which represents azimuth direction ( angle from north in clockwise direction) values. But there is a problem. Say, for instance, while 1 and 359 indicate somewhat same direction, interpolation puts values in the range from 1 to 359. What can I do to solve the problem ? Anything you offer ? thanks in advance Ahmet Temiz General Directory of
2017 Dec 20
2
outlining (highlighting) pixels in ggplot2
...0.0501, -0.0075, -0.0096, -0.0123, -0.0200, -0.0288, -2.65e-02, -2.08e-02, -0.0176, -0.0146, -0.0067, -0.0038, -0.0029, -0.0154, -0.0162, -0.0252, -0.0299, -0.0350, -3.40e-02, -2.51e-02, -0.0172, -0.0139, -0.0091, -0.0119, -0.0156), nrow = 15, ncol = 12, byrow=TRUE, dimnames = list(rev(c("TH1", "IN1", "IN3", "GL1", "LH1", "ED9", "TC1", "TC2", "TC3", "UT1", "UT3", "UT5", "GC1", "BC1", "WC1")), c(format(seq(as.Date(&...
1999 Aug 03
1
legend in coplot output
...(list ( Qu1 = c(1,2,3,4,5,6,7,8,3,2), Qu2 = c(3,4,5,6,7,8,9,9,6,3), Ku1 = structure (factor ( c(1,1,1,1,2,1,2,2,1,1),levels=1:2),.Label=c("Kmin","Kmax")), Ph1 = structure (factor ( c(1,1,3,2,3,3,2,3,2,1),levels=1:3),.Label=c("Pmin","Pmean","Pmax")), Th1 = structure( factor( c(1,1,2,4,3,3,2,4,2,1),levels=1:4),.Label=c("Tmin_in","Tmax_in","Tmin_out","Tmax_out"))), row.names = c("At1","At2","At3","At4","At5","At6","At7","At8","...
2017 Dec 20
0
outlining (highlighting) pixels in ggplot2
..., -0.0123, -0.0200, -0.0288, -2.65e-02, -2.08e-02, -0.0176, > -0.0146, -0.0067, -0.0038, -0.0029, > -0.0154, -0.0162, -0.0252, -0.0299, -0.0350, -3.40e-02, -2.51e-02, -0.0172, > -0.0139, -0.0091, -0.0119, -0.0156), > nrow = 15, ncol = 12, byrow=TRUE, > dimnames = list(rev(c("TH1", "IN1", "IN3", "GL1", "LH1", "ED9", "TC1", > "TC2", "TC3", "UT1", "UT3", "UT5", "GC1", "BC1", "WC1")), > c(format(seq...