I have this plot:
where on y axis there are catch fish data (in a certain period), and on x axis there are wind intensity (meters/second). The data are 671. The code is:
catch <- data.frame(catch) #ncol=1,nrow=671
w.int <- data.frame(wind) #ncol=1, nrow=671
plot(w.int,catch,type="p")
My question is: how can fit a best nonlinear estimation of my data, and obtain an explicative equation?
The expected result is like this:
On the title there is the potential explicative equation of my data. How can realize this with R?
I try with this code:
model <- lm(catch~poly(w.int,5))
predicted.intervals <- predict(model,data.frame(x=w.int[,1]),interval='confidence',
level=0.99)
I don't understand if the result of equation is the best nonlinear fit, like figure 2.
Final i would like plot the fit line and the equation fit on graph.