search for: th2

Displaying 13 results from an estimated 13 matches for "th2".

Did you mean: th
2006 Nov 21
2
Symbolic derivation using D in package stats - how do I properly convert the returned call into a character string?
...for d=3, but for d=4 something strange happens: d<-4; 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)) + (((1 - 2 + u2^(-th2)) + (((1 - 2 + u3^(-th3)) + u4^(-th3))^(-1/th3))^(-th2))^(-1/th2))^(-th1))^(-1/th1))) dC2 <- expression((((1 - 2 + u1^(-th1)) + (((1 - 2 + u2^(-th2)) + u3^(-th2))^(-1/th2))^(-th1))^(-1/th1))) for(j in 1:(d-1)) { dC1<-D(expr=dC1,name=u[j]); dC2<-D(expr=dC2,name=u[j]) } F <- paste(&quot...
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 random...
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 message:...
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.209...
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) ...... ......etc...
2007 Jul 07
3
color scale in rgl plots
...at 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. Than...
2008 Dec 04
0
integration within maximum likelihood
...e. 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 +thb*y$b1 +thc*y$c1...
2009 Mar 23
0
Problems with adapt
...preciate 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) { #Beggin Loop lstarpr...
2009 May 22
1
Forcing a variableinto a model using stepAIC
...d 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
2000 Sep 11
0
SAMPLS R implementation : pbm with algorithm application
...h =1,2,3...hmax s=Cyh center s working scalar for prediction sample s*=c*Tyh orthogonalize s to previous t: for g=1,...(h-1), s=s-(tgTs/tgTtg)tg orthogonalize s* to previous t*: for g=1,...(h-1), s*=s*-(tgTs/tgTtg)t*g t*h=s* th=s th2=tTt betah=(tTyh)/th2 update yh+1=yh-betahth buid up prediction y*h+1=y*h+betaht*h end of cycle ----------------------------------- R-code ##xe and ye are the explanatories and responses matrices, xtest and ytestsampls the variables for 1 sample x2<-scale(xe,sc...
2008 Dec 20
1
pygrub and xm-debian.cfg, other notes on lenny test
I've just done a fresh lenny amd64 install, and taken the xm-debian.cfg example: http://people.debian.org/~joeyh/d-i/images/daily/netboot/xen/xm-debian.cfg and built a 32 bit lenny inside a 64 bit lenny dom0 # xm create -c xm-th2.cfg install=true install-installer=http://people.debian.org/~joeyh/d-i/images/daily/ When I try to boot the domU: # xm create -c xm-debian.cfg it complains: Error: Bootloader isn't executable I found that I had to edit xm-debian.cfg and insert the full bootloader path: if not xm_vars...
2009 Jul 23
1
[PATCH server] changes required for fedora rawhide inclusion.
...$^Bv^^>+S5A at +aR`4b`bi9+oEwDb3f^8XU~ ze}cd=A at xB|!WunE2z1`NfeXBmA20B3;&<;s?R$tY1B3Pvl<d2Y5D*JMM3w&*RqDq& z4p30ze?+1M>Yt3m7{)nS?XgN#>e8_!2e0Inr%4@{MqbRcG>&PsDwrCG-PH at CtD|7# zov!9$axciqy?{<#Aa}1MgIAIhE2~zDu8fvtxKQo$qR^OV9iNKiSYpfLQxyJGlo&^Z z>ZU_=t?B(th2+6IUh=k$Wqc_zMxQ!9_+FkZIyytG+{}6+INsw;Dr%pQT-8 at rRTGml zzP2(Zk&73>?L7w{HW$I+xJ7U at wg}co7r|iyR#Y>Y2&2&q)oddfsVKRP4BAeP-MSq{ zVH*JvJX543vcdDEw2y<<lD=z+f)p~RHqwv2JqPbF`>`XgAM0cNcsSaR9R#eXW?EF* zTSanuY{s_A8QTh>ZzXrnA%o|L8Ji>IKSP#DlT8adbgU;DN8y>#x{iwEtXN$~WnD*6 z*H...