Performs the updated nonlinear least squares (NLS) regression method for the cosine model (see Chazin et al. 2019).
sine_OLS(data)
data | A data frame that contains the data for one individual. There should be two columns with names 'distance' and 'oxygen'. |
---|
A fitted model object from the nls function in R:
an 'nlsModel' object incorporating the model.
a list with convergence information
the expression that was passed to 'nls' as the data argument. The actual data values are present in the environment of the 'm' component.
the matched call with several components, notably 'algorithm'
the '"dataClasses"' attribute (if any) of the '"terms"' attribute of the model frame.
the control 'list' used
Florent Baty, Christian Ritz, Sandrine Charles, Martin Brutsche, Jean-Pierre Flandrois, Marie-Laure Delignette-Muller (2015). A Toolbox for Nonlinear Regression in R: The Package nlstools. Journal of Statistical Software, 66(5), 1-21. URL http://www.jstatsoft.org/v66/i05/.
#> Nonlinear regression model #> model: oxygen ~ intercept + amplitude * cos(frequency * distance + phase) #> data: data #> intercept amplitude phase frequency #> -4.2485 5.2653 0.7701 0.1657 #> residual sum-of-squares: 1.371 #> #> Number of iterations to convergence: 6 #> Achieved convergence tolerance: 2.407e-06