Skip to content
Prev 294872 / 398503 Next

nls and if statements

On May 17, 2012, at 10:06 AM, DWatts wrote:

            
Perhaps recasting as Boolean equivalent:

nlstest== <- nls({Cfl~ (Pw>z)*K*exp(-b*Pw)+c) +
                        !(Pw>z)*(K*(exp(-a*Tsoil))*exp(-b*Pw)+c)},
              start=c(K=5.5, a=0.1, b=0.1, c=2, z=5))
Untested in absence of data.