I am trying to do a polynomial fit for some data, so far I have found the functions "ChnRegrXYCalc" and "ChnApprXYCalc" but I haven't found the way to choose the order of the polynomial fit. Is there a way to select the order of the polynomial fit?
There is a DIAdem ANALYSIS function that does multi-polynomial curve fitting. It's included in the Advanced and Professional Edition of DIAdem.
In the DIAdem ANALYSIS panel select "Curve Fitting" and then "Approximate"
In the dialog, select your polynomial, check the preview and then execute the function with "Calculate" or "OK".
Let me know if you have additional questions,
Can you tell me how to translate that into VBS code? Is there a function where I can type the order I need to calculate the polynomial fit?
If you're in an ANSLYSIS dialog, you can always click on the <Help> button at the bottom right of the dialog. This will pop up a Help page that talks about how to use the dialog-- not what you want. BUT if you look all the way at the bottom of that Help page, you will see a link to the command or commands behind that dialog, and they WILL show you how to call that functionality with a VBScript.
DIAdem Product Support Engineer
I've checked with R&D, and I'm sorry to report that the approximation function in the DIAdem ANALYSIS palette does not support fixing certain points in the analysis, so that the resulting fit is constrained/guaranteed to pass through those fixed points.
I don't have a suggestion for you,
Senior Technical Support Engineer