Displaying 1 result from an estimated 1 matches for "expsumnoisy".
2007 Apr 16
1
nls with algorithm = "port", starting values
...lly decaying data
getExpmat <- function(theta, t)
{
conc <- matrix(nrow = length(t), ncol = length(theta))
for(i in 1:length(theta)) {
conc[, i] <- exp(- theta[i] * t)
}
conc
}
expsum <- as.vector(getExpmat(c(.05,.005), 1:100) %*% c(1,1))
expsumNoisy <- expsum + max(expsum) *.001 * rnorm(100)
expsum.df <-data.frame(expsumNoisy)
## estimate decay rates, amplitudes with default Gauss-Newton
summary (nls(expsumNoisy ~ getExpmat(k, 1:100) %*% sp, expsum.df, start =
list(k = c(.6,.02), sp = c(1,2)), trace=TRUE, control =
nls.control(maxiter=2...