cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Non-linear regression example

wschrabi-disabl
1-Newbie

Non-linear regression example

thanks a lot my friends,





I have studied now the term Fisher info and the normal non-lin regression analyses. I think there is a link between these terms, but I could not figure out it in the literature. Here another nice MC11 ws with PDF from the S-Plus paper.


Now the WS is MC11 compateble.
50 REPLIES 50

While it is an interesting intwllectual excercise, the design of the sheet is such that you don't have to understand exactly how the function work to use them. Just copy the collapsed area with the function definitions into your work sheet and use the ones that you need.

I recommend against attempting to modify the functions to tailor them for specific uses. Rather, if needed, create wrapper functions that use the functions a provided. These functions have been tweaked in various ways to avoid the bugs and inconsistancies present in the various Mathcad versions.


On a separate note, based on some other related posts, using numeric derivatives in the function passed to genfit is a bad idea. It results in genfit becomming very slow. This should not be a problem, as there is really no reason to ever use genfit anyway, and further the MC14 version can operate without derivatives being provided.
__________________
� � � � Tom Gutman

In the case of Levenberg-Marquardt, ERR represents the square root of the SSE (Sum Squared Error).
If you use one of the other solvers on this problem, you have to square and sum the errors in the constraint equation or get very poor results. It is always worth trying different problem setups if you are having trouble reaching a satisfactory solution.
Note that Minerr is designed to minimize the error. However, if Minerr cannot find a solution after 2000 iterations, it quits and returns whatever solution is currently available. This solution only represents how far Minerr got and is not necessarily a good solution. It's always important to verify that the result from the solver is a reasonable solution. If not, try examining the intermediate values found by the solver using tracing, try different guesses, or use a different method.

And the relevance to my post (to which this is a reply) is .....
__________________
� � � � Tom Gutman

A mistake of mine. I should have posted it to a reply by jmG to an earlier worksheet I composed wherein I complained Minerr would not arrive at a solution. jmG did not offer any explanation. I found one with another on line search. That is what I entered to your thread.

On 4/3/2010 10:46:01 PM, bones7xx wrote:
>A mistake of mine. I should
>have posted it to a reply by
>jmG to an earlier worksheet I
>composed wherein I complained
>Minerr would not arrive at a
>solution. jmG did not offer
>any explanation. I found one
>with another on line search.
>That is what I entered to your
>thread.
_______________________________

Minerr fails [especially LM] on model functions that are too reflexive ... "found a number greater than e307" ... "does not converge to a solution". I have several such reflexive functions in mind. Rayleigh data set is one of them that I abandoned for years and solved it less than a month ago.

jmG

On 4/3/2010 10:06:31 PM, Tom_Gutman wrote:
>And the relevance to my post
>(to which this is a reply) is
>.....
>__________________
>� � � � Tom Gutman



Thanks Mr GUtman, here my first use of your Jacobian fns.

Your sheets leave something to be desired, as the data input table contains no data. Perhaps a problem in conversion to MC11 format (not all data tables survive the conversion).

The function you want is Gradient, not Jacobian. While Jacobian can be used, as the gradient is a special case of the Jocobian (see the descriptions of the various functions), the application of Gradient is more direct and appropriate.

If you look up the easy genfit setup sheet there is a function there that is even more direct, as it avoids a separate stack to combine the original function and the derivatives. Since I no longer consider genfit worth using, I don't push that sheet a lot. But you seem to be fixated on trying to use genfit. I don't understand why.
__________________
� � � � Tom Gutman

Dear Mr Gutmann,
no I just used genfit as it was handy. But I also prefer Minerr. Could you see the data in MC14? I do not know how I can save it as MC11 with the data. Thanks a lot. Walter

No, the data is not visible to me in the MC14 sheet. That may have been saved after saving ar MC11, which could have destroyed the table. If you download the sheed, do you see the data?
__________________
� � � � Tom Gutman

Then the red data table is not from Walter converting his 14 to 11.
I got the data from Theodore, but how he got them ?

On 4/6/2010 8:54:30 PM, Tom_Gutman wrote:

>No, the data is not visible to

>me in the MC14 sheet. That

>may have been saved after

>saving ar MC11, which could

>have destroyed the table. If

>you download the sheed, do you

>see the data?

>__________________

>� � � � Tom Gutman







Mr Gutman, I hope it will work now. Here the sheet with the data as MC11. And MC14 attachment.

Comments in the work sheets.

jmG

Comments:
1. What is the relationship: Jacobian and the fit ?
2. Your data set is still red for 11 users
In that case after being mentioned , make it like green demo.
3. I reject your modulo 2 fit, though not bad .

2^x is not a primary approximation
exp(x) is a primary approximation

The conversion from exp(x) to 2^x introduces errors.

jmG

Thanks jmG, yes the exp is much more naturally. Great idea, I just wrote it from the paper - but you did in fact an improvement. Walter

The worksheet on Weight Loss posted by Walter on April 4 at 1:45 PM offers a chance to study home measurements of stystolic blood pressure of a patient, and get some insight as to what Fisher's Information is all about. Then, having described the data statistically I use probability theory to predict the outcome of treatments for high blood pressure as far as 365 days in the future.
Any comments will be very welcome.

Theodore, great work. I learned a lot new things with your ws. Thanks. Walter


>However, if Minerr cannot find
>a solution after 2000
>iterations, it quits and
>returns whatever solution is
>currently available.

Thanks, good to know. Moreover I discoverd that MC14 uses an optimzed LM and MC11 an old one. So the ERR is the same but the results are different.

jmG, I could successfully calculate your ws in MC11. BUT when I open it in MC14 there other sys-parameters are calculated. (Pls note, the fix defined D) I have checkt that the same nonlinear method is used for the minerr. Why is that so?
Do I understand that correctly, that MC14 uses the optimized LM method and MC11 uses the non-optimzied Leven.-Marq. method?

On 4/1/2010 8:09:06 AM, wschrabi wrote:
>jmG, I could successfully
>calculate your ws in MC11. BUT
>when I open it in MC14 there
>other sys-parameters are
>calculated. (Pls note, the fix
>defined D) I have checkt that
>the same nonlinear method is
>used for the minerr. Why is
>that so?
Do I understand that
>correctly, that MC14 uses the
>optimized LM method and MC11
>uses the non-optimzied
>Leven.-Marq. method?
______________________________

My work sheet as posted is Levenberg-Marquardt, if you got it otherwise, then a transmission problem or your 14 ignores the option and defaults to other. I don't disagree you don't optimize for D as well but you mentioned the data were from book. Then in my interpretation, D is to be optimized too... you see my point. From your PDF and the glycerose data, something is wrong. It might just be in the setup of the DE or the book. One way or another, a two variables DE system reverts back to a 2nd order single DE. What that means is that the system behaves like a system under control.

I read lot of those medical papers, no maths, no data ... only a hint from a Russian doc. What that means is that your DE system may not be correct, otherwise you would get the same or very close to the Lambert. I have tried to ignore the first point in the Minerr, not to avail. The conclusion is that the DE system is close but incorrect. If a compass does not draw a circle, either the compass or the operator is kaput [maybe both ].

jmG

On 4/1/2010 10:38:40 AM, jmG wrote:
>On 4/1/2010 8:09:06 AM, wschrabi wrote:
>>jmG, I could successfully
>>calculate your ws in MC11. BUT
>>when I open it in MC14 there
>>other sys-parameters are
>>calculated. (Pls note, the fix
>>defined D) I have checkt that
>>the same nonlinear method is
>>used for the minerr. Why is
>>that so?
>Do I understand that
>>correctly, that MC14 uses the
>>optimized LM method and MC11
>>uses the non-optimzied
>>Leven.-Marq. method?
>______________________________
>
>My work sheet as posted is
>Levenberg-Marquardt, if you got it
>otherwise, then a transmission problem
>or your 14 ignores the option and
>defaults to other. I don't disagree you
>don't optimize for D as well but you
>mentioned the data were from book.

Yes, you are correct. The data for the glc curve from the book may not be correct, as it makes a different if the blood is taken from the capilary or from the vene. Moreover also the DE do not build the complet human being - but is a simple form of the glc-ins cycle.

>Then
>in my interpretation, D is to be
>optimized too... you see my point.

Yes that is also correct, but in the normal med work you have the Dose (= input) and the output (Glc, Ins data) and want to identify the sys-parameters.


From
>your PDF and the glycerose data,
>something is wrong. It might just be in
>the setup of the DE or the book. One way
>or another, a two variables DE system
>reverts back to a 2nd order single DE.
>What that means is that the system
>behaves like a system under control.
>
>I read lot of those medical papers, no
>maths, no data ... only a hint from a
>Russian doc. What that means is that
>your DE system may not be correct,
>otherwise you would get the same or very
>close to the Lambert. I have tried to
>ignore the first point in the Minerr,
>not to avail. The conclusion is that the
>DE system is close but incorrect. If a
>compass does not draw a circle, either
>the compass or the operator is kaput
>[maybe both ].
>
>jmG


On 3/30/2010 11:02:59 AM, wschrabi wrote:
>thanks a lot my friends,
I
>have studied now the term
>Fisher info and the normal
>non-lin regression analyses. I
>think there is a link between
>these terms, but I could not
>figure out it in the
>literature. Here another nice
>MC11 ws with PDF from the
>S-Plus paper.
Now the WS is
>MC11 compateble.
______________________________

Ref: US decenial census 1790, 2000

NO, not compatible . The data table is red and empty. So, if you don't post the data set, not possible fit by 11 or lower users.

jmG





Top Tags