Skip to content
Prev 336511 / 398502 Next

Regression of complex-valued functions

On Feb 9, 2014, at 2:45 PM, Andrea Graziani wrote:

            
Others have pointed out the theoretical difficulties regarding curve fitting on the complex plane. My concern looking at this is that you have apparently lapse into mathematical notation rather than functional programming notation above:

This 
2i*pi*10^(logtau)*f*10^logaT

Would need to be this:

 2*i*pi*10^(logtau)*f*10^logaT

You would start getting parser errors since '2i' is not a valid token name. I would also worry about negative powers. They can sometimes be numerically unstable. 

And you have not offered the values for temperatures which I suspect are the items in your start list: loga40=-3.76,loga30=-2.63,loga20=-1.39,loga0=1.68. I would think these are fixed rather than something to be optimized. You can leave them in the global environment or build them into the function but I don't think they should be in your start list. (Frede Aakmann T?gersen noted that issue but did not build a solution that incorporated addressed that concern.)

To examine that relationship you would:

loga40=-3.76;loga30=-2.63;loga20=-1.39;loga0=1.68
logaT <- c(rep(loga40,5),rep(loga30,5),rep(loga20,5),rep(0,5),rep(loga0,5))
 # To visualize the data:

 plot(logaT,Re(E), log="y")
 plot(logaT,Im(E), log="y")