Displaying 1 result from an estimated 1 matches for "ydebug".
Did you mean:
debug
2010 May 11
1
nls() and nls2() behavior?
...104,0.3240,0.3404,0.3847,0.5571,0.5432,0.1326)
dummy=c(rep( "m1", 7), rep( "m2", 3), rep( "m3", 5))
d= data.frame( y=y, x=x, dummy=dummy );
print(lm( y ~ as.factor(dummy) + x, data=d )) ## a simple fixed-effects model
objective.xs <- function( b, m1, m2, m3, x, ydebug ) {
tgts.mean= c(rep( m1, 7), rep( m2, 3), rep( m3, 5));
yhat= tgts.mean + b*x
#debug
cat("Parameters: b=", b, " m123=", m1, m2, m3, " leading to ",
sum( (ydebug-yhat)^2 ), "\n")
return( yhat );
}
sameformula= (y ~ objective.xs(b, m1, m2, m3, x,...