This is my first question. I have the following data that I'd like to approximate as a parametric function:
\begin{align} y = a + (bx_1 + cx_2 + dx_3 + ex_1x_2 + fx_1x_3 + gx_2x_3 + hx_1x_2x_3 + i)*(j*\sin(kx_1x_2x_3) + l\cos(mx_1x_2x_3)) \end{align}
testdata <- read.csv('..path_to_file/gistfile1.txt', sep = "")
plot(1:35,testdata$X0, col = 'blue', pch = 19, ylim = c(0,8),type = "l",lwd = 2, xlab = "x", ylab = "y_i",cex.lab = 2)
lines(1:35,testdata$X1, col = 'red', pch = 19, ylim = c(0,1),lwd = 2)
lines(1:35,testdata$X1.1, col = 'green', pch = 19, ylim = c(0,1),lwd = 2)
lines(1:35,testdata$X8, col = 'magenta', pch = 19, ylim = c(0,1),lwd = 2)
leg.txt <- (c("y","x1","x2","x3"))
legend(18,8,leg.txt, col = c('blue','red','green','magenta'), lty = 1,lwd= 2,border = 'white')
Any suggestions how to modify the function shown below so as to get a closer fit?