I have a series of high-low tide values, approx. every 6h, and each one has the corresponding time. I would like to get (an estimation of) the values between each record. I was thinking I could create a sinusoidal curve but I am not sure if just simply giving the min-max y-values are enough.
Here is a part of the data:
y <- c(0.96, 0.27, 1.11, 0.35, 0.90, 0.35, 1.06, 0.34, 0.90, 0.38, 1.06, 0.28)
t <- c(42489.02, 42489.27, 42489.55, 42489.82, 42490.07, 42490.32, 42490.60, 42490.88, 42491.13, 42491.39, 42491.66, 42491.94)
I tried to apply the following formula (following this question: Fit a sinusoidal term to data):
res <- nls(y ~ A*sin(omega*t+phi)+C, data=data.frame(t,y), start=list(A=1,omega=1,phi=1,C=1))
But I got this error:
Error in nls(y ~ A * sin(omega * t + phi) + C, data = data.frame(t, y), :
step factor 0.000488281 reduced below 'minFactor' of 0.000976562
1º Question: Is this approach correct for the result I want?
2º Question: If it is, how can I solve this error?