0

I have this plot:

enter image description here

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:

enter image description here

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.

hrbrmstr
  • 77,368
  • 11
  • 139
  • 205
skylobo
  • 151
  • 1
  • 9
  • It would be preferable to use absolute values as y, I guess that would be count data. You could then use an appropriate GLM or GAM. – Roland Nov 25 '16 at 19:10
  • Zheyuan in the title there are two equation, because the first is the possible explicative model (the input term in software STATISTICA), and the second equation is the result of fit on my data and the input term – skylobo Nov 26 '16 at 14:44
  • I tried with this code: x= w.int y=catch , df <- data.frame(x,y) m <- glm(y ~ x,family = gaussian, data = df) but the result it's not what i want... the model is: a*exp(-((x-b)^2/(2*c^2))), where a,b,c are unknowns to be estimated and x is w.int. How can estimate the curve? thank you – skylobo Nov 28 '16 at 08:16

0 Answers0