# Approximation theory

1. Jul 15, 2011

### a.mlw.walker

Hi
Is there anyone here who has a good understanding of using approximation theory and parameter estimation techniques who can help me understand a chapter of a paper, and why certain techniques have been used. I have tried to use the given data, and matlabs optimization tools to follow the chapter through, but I cannot get a good fitting curve (at all). the method requires Levenberg marquardt to approximate some parameters, golden section search to improve them, and then a trisection search (which I think is golden section search???) to find more parameters based on the first ones found.

Thanks

2. Jul 18, 2011

### clarkwgriswol

Could you post a reference to the article? Not sure if I could help but I'd be happy to take a look.

3. Jul 19, 2011

### a.mlw.walker

Great thanks. I have the relevent extract of the paper, which i have attached. I basically want to use levenberg marquardt to solve equation 40 for a,b and c0. The value Tk is:

I have timings for tk: 1.994, 1.806, 1.632, 1.493, 1.2
x tk
1 1.2
2 1.493
3 1.632
4 1.806
5 1.994
Its an oscilating system that slows with time.
Equation 41 apparently is to refine the parameters further, however golden section searc i thought finds a minimum, however i am not sure what minimum, because plotting those points above gives a constant downward gradient.
Equation 42 requires the approximations from 41.

I cant find a way (that i can get to work) to approximate those values. any ideas?

(P.S. I cant upload twice so the image is my attachment about the same question here: https://www.physicsforums.com/showthread.php?t=513060)

4. Jul 19, 2011

### hotvette

I found a link to a pdf of the actual paper, which should make the discussion a bit easier.

http://www.roulette.gmxhome.de/roulette[1].pdf

Equation 40 is a least squares formulation based on equation 35 (which is what I thought a couple of years ago when this topic was first introduced). Based on your 5 timings I did a quick and dirty curve fit using downhill simplex. Not sure I did it right, but both a and c0 are negative and the fit doesn't appear to be very good. The data look rather linear. Is this the same result you got with Matlab?

#### Attached Files:

• ###### plot3.jpg
File size:
10.5 KB
Views:
57
Last edited: Jul 19, 2011
5. Jul 20, 2011

### a.mlw.walker

Yeah for the data points, I used the matlab curve fitting tool, but I couldnt get it to do a levenberg marquardt fit. It couldnt converge. Did you use my values for x, I think they should start at zero not 1 thought, but I havent tried that yet. Is yours a levenberg marquardt fit?
Equation 41 in the paper is supposed to refine the parameters, did you read that bit?

On that website, under manual, you can see his values for a and c0 can be negative. thats not a problem i dont think.

I used matlab though to try and do a downhill simplex, but it still cant converge. how did you do that?
The equation i am fitting to is:
Fitted_Curve = (1/(a*b))*(c-asinh(sinh(c)*exp(a*Input*2*pi)));

but the graph after trying to solve is:

#### Attached Files:

• ###### graph.JPG
File size:
7.5 KB
Views:
48
Last edited: Jul 20, 2011
6. Jul 20, 2011

### a.mlw.walker

Actually I have managed to get it to plot it. But like you, not a very good fit...

#### Attached Files:

• ###### graph.JPG
File size:
10.4 KB
Views:
51
7. Jul 20, 2011

### D H

Staff Emeritus
You got a bad fit because you fit the wrong parameter. You should be fitting a, b, and c0 by minimizing equation 40,

$$S(a,b,c_0) = \sum_{k=0}^N \left\{t_k - \frac 1{ab} \left(c_0-\sinh^{-1}(\sinh c_0\cdot e^{ak\pi})\right)\right\}^2$$

or you should be fitting a by minimizing equation 41.

8. Jul 20, 2011

### a.mlw.walker

what is different? are you saying that you either do 40 or 41, not both?

9. Jul 20, 2011

### D H

Staff Emeritus
I am saying that the one thing you shouldn't do is to do the fit from post #5 (as quoted in post #7).

From the paper, it looks like the author first did a multivariate fit in equation #40 on parameters a and b and then refined that estimate by doing a fit on a only via equation #41. In other words, equation #40 when minimized gives the final value for b but only an initial guess for a. The final value for a comes from minimizing equation #41.

Note well: That `with' section after equation #41 applies to both equations #40 and #41. In particular, note that c0 is not a tuning parameter. It is instead an ugly expression that is a function of the tuning parameters a and b and of the time difference t1-t0.

10. Jul 20, 2011

### a.mlw.walker

I tried that, but I cant get it to produce a good fit (compared to the above graphs) at all. It is closer estimating c0.
"The equation i am fitting to is:
Fitted_Curve = (1/(a*b))*(c-asinh(sinh(c)*exp(a*Input*2*pi)));"
What I am fitting is actually the difference between this and the actual data.

I understand to freeze b in equation 41 though, however I cant get the golden section search to produce a better estimate, however I am still approximating for c0 at this stage.

11. Jul 20, 2011

### D H

Staff Emeritus
You shouldn't be estimating c0. It is merely a stand-in for

$$c_0 = -\coth^{-1}\left(\frac{e^{a2\pi}-\cosh(ab(t_1-t_0))}{\sinh(ab(t_1-t_0))}\right)$$

12. Jul 20, 2011

### a.mlw.walker

yeah, i cant get that to converge. by the way is t1 - t0 the values up there or is it the difference between those times? i,e tk(1) - tk(2)

13. Jul 20, 2011

### hotvette

Hmmm, if that's the case, the author's description of equation 40 is misleading. He indicates the function to minimize is a function of a,b,c0 implying that all three need to be estimated. He should have said the function to minimize is a function of a,b where c0=xxxxx. Not well written.

14. Jul 20, 2011

### a.mlw.walker

hotvette please could you try it, i cent get it work

15. Jul 20, 2011

### hotvette

Yeah, I was wondering that also. If the author uses consistent notation, t0 should be t @ k=0, which is zero according to equation 35. Kind of confusing.

16. Jul 20, 2011

### hotvette

If you mean a two parameter estimation using post #11 as the definition of c0, sure, but I don't think the result will be much better. The data points are close to linear. I doubt they will fit an exponential decay function very well no matter how much the parameters are manipulated. In fact, the fit should be worse because the value of c0 will be restricted, but I'll give it a try (later).

17. Jul 20, 2011

### a.mlw.walker

What do you reckon about the original data being cumulative so:
x tk
1 1.2
2 2.695
3 4.325
etc etc. that way t1-t0 would be that time, but fit the curve to the cumulative times?
Edit! yeah, cumulative fits better, much better, and I am using the correct c0. however i am not using the individual timings but the cumulative time for T0, which doesnt seem correct...

Found out that T0 is the time for the initial time value, and is therefore a constant

Last edited: Jul 20, 2011
18. Jul 20, 2011

### hotvette

Yep, looks better using cumulative. Attached is three parameter fit. However, what do you mean by "Found out that T0 is the time for the initial time value, and is therefore a constant"? Pls elaborate.

#### Attached Files:

• ###### plot.jpg
File size:
8.9 KB
Views:
64
Last edited: Jul 20, 2011
19. Jul 20, 2011

### a.mlw.walker

Yeah I got better too, but mine curves the other way...(attached). That is using D H's idea that c0 is not a parameter in itself.
The website that you said you found the whole document at says that T0 is the time of the initial revolution, on the page called manual at the bottom somewhere....

What have you plotted on the y axis? I plotted the cumulative time?

#### Attached Files:

• ###### graph2.JPG
File size:
10.5 KB
Views:
55
20. Jul 20, 2011

### hotvette

I made goof and just now edited my last post with the correct version. Almost a perfect fit (looks identical to yours), though I still used 3 parameters. Looks like you are on the right track.

Last edited: Jul 20, 2011