Displaying 1 result from an estimated 1 matches for "errsq".
Did you mean:
errs
2008 May 07
3
function in nls argument
...(ST04, SM08b, ch2no, a, b, d, E)
{
predR <-
(a*SM08b^I(2)+b*SM08b+d)*exp(E*((1/(283.15-227.13))-(1/(ST04+273.15-227.13))))
abserr <- abs(ch2no-predR)
qnum <- quantile(abserr, probs=0.95, na.rm=T)
is.na(abserr) <- (abserr > qnum)
errsq <- sum(abserr^2, na.rm=T)
errsq
}
Then I want to optimize parameters a,b,d and E as to
minimize the function output with the following:
optim.model<-nls(nulldat ~ optim.fun(ST04, SM08b,
ch2no, a, b, d, E), data=tower,
start=list(a=-0.003,b=0.13,d=0.50, E=400), na.action =
na...