Displaying 3 results from an estimated 3 matches for "yht".
Did you mean:
yet
2008 Jul 03
1
Problem in applying conditional looping
...ve.
library(mvtnorm)
library(combinat)
yg <- function(n,m,s) {
n<-10
m<-c(1,2)
s<- matrix(c(4,.2,.2,3), ncol=2)
x <- rmvnorm(n=n, mean=m, sigma=s)
pi <- x[,2]/sum(x[,2])
P <- pi*((1-2*pi)/(1-pi)+sum(pi/(1-pi)))
Pi<-t(combn(pi,2))
y<-t(combn(x[,1],2))
PI<-t(combn(P,2))
yht <- y[,1]/PI[,1]+ y[,2]/PI[,2]
*PIJ <- (Pi[,1]*Pi[,2]*(2-Pi[,1]-Pi[,2]))/((1-Pi[,1])*(1-Pi[,2]))*
Eyht <- sum(yht*PIJ)
E2yht <- sum(yht^2*PIJ)
var1 <- E2yht - Eyht^2
var1
}
I want to impose the condition on PIJ(which is a vector). If any value in
the PIJ is negative then go back an...
2010 Feb 09
1
question about nlme...
I am looking for R code to be able to fit a linear-linear piecewise
model with person-specific changepoint. I have searched the web, but
have not been able to locate any code.
Below is my attempt at some code:
chgpt = function(a1,a2,a3,gam,wave){
yht=numeric(10)
y1=(wave <= gam)*(a1+(a2*wave))
y2=(wave > gam)*((a1+(a2-a3)*gam)+a3*wave)
yhat=y1+y2
return(yht)
}
nl.dat <- nlme(y ~ chgpt(a1,a2,a3,gam,wave)~wave|id,
data = ndat,
fixed = a1 + a2 + a3 + gam,
random = a1 + a2 + a3,
start = c(a1...
2009 Jul 23
1
[PATCH server] changes required for fedora rawhide inclusion.
...oyJ>gM at Wkv`n{_sp52FwXRVBG|wgV0($G#QZImX6b(|3lcXNPtsxu~645uH
zGQMe)4B<+A2q)c8>>W)yTStYiXz!v-I$B|wAaaXGq|d)3l99NNCL{6HUSg=5L%2kV
zGLZUev^CEzbh%b<XWc5bDj8d;R;6MqsPg)0KLX~ydJExuxmm;Ms86x^iCS#FiRWsg
z7_()uIb195rib_P&;f3)LD*WrI>36s2EazZCcsxnw;9hZfR6!HfCL~3NCCD2ssS~C
zTEI5ICxGpM9e|yHT}E-YE5iqPXg4=M#rJN&9>Dv6y?}jy{RZ)~n}_!QE1dm2w1=Aq
z4ElG_C}QRzqfMP;er9xRZXPx|wlI$v9j`Et8Xd1Rj~N|Xnx7jTo0-Rrj#rr{jE+~E
zUl?uTl6lhT*vkCU=y;9!mC^B9^OVuC(EQryc%6Bg-p<h5H%7<n&9g?w*5)~*W0Co-
z(Xmap7U4Z&qm1V2l>2O*a-YyC_i=pFm4q4z7FtN!K=N#Z8mgjal^UvbPc+AB)liB8
zQ)*}jJ$I<~)b_IG%Bb}uq...