# NOT RUN {
# Aphids.
fit1 <- mixreg(aphRel,plntsInf,ncomp=2,seed=42,data=aphids)
plot(fit1)
thStrt <- list(list(beta=c(3.0,0.1),sigsq=16,lambda=0.5),
list(beta=c(0.0,0.0),sigsq=16,lambda=0.5))
fit2 <- mixreg(aphRel,plntsInf,ncomp=2,thetaStart=thStrt,data=aphids)
fit3 <- mixreg(plntsInf ~ aphRel,ncomp=2,thetaStart=thStrt,data=aphids)
# Kilns.
# }
# NOT RUN {
vfit <- visualFit(y ~ x,ncomp=3, data=kilnAoneOut)
fit <- mixreg(y ~ x,ncomp=3,data=kilnAoneOut,thetaStart=vfit$theta)
# }
# NOT RUN {
thStrt <- list(
list(beta=c(26.07,48808),sigsq=1.1573,lambda=0.33333333),
list(beta=c(23.48,32387),sigsq=1.8730,lambda=0.33333333),
list(beta=c(-0.0597,20760),sigsq=0.2478,lambda=0.33333333)
)
# Roughly the value of vfit$theta.
fit <- mixreg(y ~ x,ncomp=3,data=kilnAoneOut,thetaStart=thStrt)
plot(fit)
# Kilns, zero intercept model.
# }
# NOT RUN {
vfit <- visualFit(y ~ x - 1,ncomp=3, data=kilnAoneOut)
fit <- mixreg(y ~ x - 1,ncomp=3,data=kilnAoneOut,thetaStart=vfit$theta)
# }
# NOT RUN {
thStrt <- list(list(beta=50900,sigsq=3.297,lambda=0.33333333),
list(beta=33800,sigsq=25.52,lambda=0.33333333),
list(beta=20755,sigsq=0.2477,lambda=0.33333333))
# Roughly the value of vfit$theta.
fit <- mixreg(y ~ x - 1,ncomp=3,data=kilnAoneOut,thetaStart=thStrt)
plot(fit) # Yikes!!! (But a plot of vfit looks practically perfect.)
fit <- mixreg(y ~ x - 1,ncomp=3,data=kilnAoneOut,thetaStart=thStrt,eqVar=TRUE)
plot(fit) # Looks fine.
# }
Run the code above in your browser using DataLab