[WP34s] Linear and nonlinear regression with L.R.

05222014, 07:39 PM
(This post was last modified: 05222014 07:43 PM by Dieter.)
Post: #1




[WP34s] Linear and nonlinear regression with L.R.
The 34s offers a L.R. command for various types of regression curves with two parameters. I am not quite happy with a few points:
1. Obviously the function is called "L.R." for historic reasons: earlier HPs like the 34C exclusively offered a Linear Regression, so the command was named accordingly. However, the 34s can do a lot more: It can calculate five different fits, i.e. linear, exponential, logarithmic, a power function, and even "the best of all these". That's why this function should be renamed to something more universal, e.g. REGR. Also the two parameters could simply be called a and b, which would make the whole thing more readable. 2. The PDF manual states that the function returns two regression coefficients a_{0} and a_{1}. But it does not say where which coefficient is returned. #) After some tests it seems that a_{0} is returned in X and a_{1} in Y. This should be added. 3. and most important: the function does not work as described in the manual. For the exponentional and power fit, the result returned in X is not a_{0}, it is ln a_{0}. This should be fixed. Not in the manual, but in the software. Example: try an exponential fit for [0, 1] and [1, e]. Since y = e^{x} this should yield 1 for a_{0} as well as a_{1}. But instead a zero is returned in X. Dieter 

05222014, 08:07 PM
Post: #2




RE: [WP34s] Linear and nonlinear regression with L.R.
Let me try to answer:


05222014, 08:39 PM
(This post was last modified: 05222014 08:41 PM by Dieter.)
Post: #3




RE: [WP34s] Linear and nonlinear regression with L.R.
(05222014 08:07 PM)walter b Wrote: In any of the cases covered, it's still a linear regression  either immediately or with transformed variables. Yes, I know how the different fits are calculated. But still the result is a linear fit only in one single case. All others are nonlinear. And that's how the manual states it: it does not say ln y = ln a_{0} + a_{1} x, but y = a_{0} · e^{a1 x}. Quote:What you complain about was already taken care of in the manual v3.2 published 15 months ago. #) Hm. Sourceforge.net has a manual file dated 20140204. The file name says "3_2.pdf" while the picture on the first page says "v. 3.1_3333". In any case it has the same text in the IOP as my version 3330: "[L.R.] returns the parameters a1 and a0 of the fit curve through the data points accumulated in the summation registers, according to the curve fit model selected (see LINF, EXPF, POWERF, and LOGF)." And that's it. If this is the version from last February, where can I find a newer version that was published a year earlier than this ?) Quote:BTW, from a mathematical point of view, calling the two regression coefficients a_{0} and a_{1} is the most general approach  you immediately know that e.g. a_{1} belongs to x^1. There are different mathematical points of view. Your example is fine for a polynomial fit, where a_{n} is the coefficient at x^{n}. Another common application in statistics is a multiple linear regression. Here the coefficients are also called a_{n}, but they refer to the variable x_{n}. Quote:Thanks for reporting that. We'll look into it. Great, thanks. Dieter 

05222014, 09:15 PM
Post: #4




RE: [WP34s] Linear and nonlinear regression with L.R.
(05222014 08:39 PM)Dieter Wrote:(05222014 08:07 PM)walter b Wrote: What you complain about was already taken care of in the manual v3.2 published 15 months ago. #) No idea where you found that file  I don't see it on the linked site. Anyway, please let me quote from the manual published on 22.2.2013: "Returns the parameters a1 (in Y) and a0 (in X) of the fit curve through the data points accumulated in the summation registers, according to the curve fit model selected (see LINF, EXPF, POWERF, and LOGF)." You find that manual here though I bet you've known that. BTW, there will be a v3.3 manual available soon as advertized in another thread. d:) 

05222014, 09:27 PM
Post: #5




RE: [WP34s] Linear and nonlinear regression with L.R.
(05222014 09:15 PM)walter b Wrote: No idea where you found that file  I don't see it on the linked site. Hm. Should I add a screenshot with a big red arrow ?) Click the link, take a look at the file list, find "Manual_wp_34s_3_1.pdf". Quote:Anyway, please let me quote from the manual published on 22.2.2013: Ah, that's the printed manual. So the one I quoted still is the last PDF version? Quote:"Returns the parameters a1 (in Y) and a0 (in X) of the fit curve through the data points accumulated in the summation registers, according to the curve fit model selected (see LINF, EXPF, POWERF, and LOGF)." That sounds better. ;) Quote:BTW, there will be a v3.3 manual available soon as advertized in another thread. PDF or print? Dieter 

05222014, 10:47 PM
Post: #6




RE: [WP34s] Linear and nonlinear regression with L.R.
...3_1.pdf vs 3_2.pdf.
Be gentle Walter... Bob Prosperi 

05232014, 06:15 AM
(This post was last modified: 05232014 06:16 AM by Dieter.)
Post: #7




RE: [WP34s] Linear and nonlinear regression with L.R.  
05242014, 02:45 PM
Post: #8




RE: [WP34s] Linear and nonlinear regression with L.R.  
05252014, 01:42 PM
Post: #9




RE: [WP34s] Linear and nonlinear regression with L.R.
(05222014 07:39 PM)Dieter Wrote: For the exponentional and power fit, the result returned in X is not a_{0}, it is ln a_{0}. This should be fixed. Not in the manual, but in the software. As promised we looked into that and fixed it so it will work the way it did on the HP42S. Pauli uploaded the update so it will be in next build of WP 34S as well as WP 31S. Thanks for the head up. d:) 

05282014, 01:39 PM
Post: #10




RE: [WP34s] Linear and nonlinear regression with L.R.
(05252014 01:42 PM)walter b Wrote: As promised we looked into that and fixed it Great, thank you. Quote:so it will work the way it did on the HP42S. Whatever this means, I never had a 42s. Did I already say that I do not think it's a good idea for a user manual to refer to half a dozen of other manuals? Quote:Pauli uploaded the update so it will be in next build of WP 34S as well as WP 31S. Just to be sure: I updated to the latest available version today, which seems to be 3.3 3653. Here the L.R. bug is still present. Dieter 

05282014, 02:58 PM
Post: #11




RE: [WP34s] Linear and nonlinear regression with L.R.
(05282014 01:39 PM)Dieter Wrote: ... I never had a 42s. Did I already say that I do not think it's a good idea for a user manual to refer to half a dozen of other manuals? That can be cured easily: get Thomas Okken's Free42S Well worthwhile IMHO. Did I tell you already I hate copying & pasting other people's thoughts? Call me conservative but whenever I find a good explanation of a particular function elsewhere exceeding some lines of text I prefer pointing to the respective manual instead of just copying said text into my manual. YMMV (05282014 01:39 PM)Dieter Wrote:Walter B Wrote:Pauli uploaded the update so it will be in next build of WP 34S as well as WP 31S. Please look up the date of build 3653 and you will be sure. #/ We need Marcus building a new build ... d:) 

05282014, 05:29 PM
(This post was last modified: 05282014 05:29 PM by SlideRule.)
Post: #12




RE: [WP34s] Linear and nonlinear regression with L.R.
Anyone care to tackle Curve Fitting?
SlideRule 

05282014, 06:12 PM
Post: #13




RE: [WP34s] Linear and nonlinear regression with L.R.
(05282014 05:29 PM)SlideRule Wrote: Anyone care to tackle Curve Fitting? Well, this is curve fitting. The L.R. command fits linear, exponential, logarithmic or power functions with two parameters to a given data set with one independent variable. So what exactly are you looking for? Polynomial fits? Multiple linear regression? Rational approximations? Dieter 

05282014, 10:00 PM
Post: #14




RE: [WP34s] Linear and nonlinear regression with L.R.
Sorry for the confusion  rhetorical question  slight attempt at veiled humor.
SlideRule 

05292014, 01:30 PM
Post: #15




RE: [WP34s] Linear and nonlinear regression with L.R.
(05282014 02:58 PM)walter b Wrote:(05282014 01:39 PM)Dieter Wrote: Just to be sure: I updated to the latest available version today, which seems to be 3.3 3653. Here the L.R. bug is still present. FYI, build 3658 is available now for testing. d:) 

05292014, 01:44 PM
Post: #16




RE: [WP34s] Linear and nonlinear regression with L.R.
(05292014 01:38 PM)fhub Wrote:(05292014 01:30 PM)walter b Wrote: FYI, build 3658 is available now for testing.Yep, many thanks to Pauli for the last fixes and Marcus for the new build! Oh, I can perfectly live without that. d:) 

05292014, 03:07 PM
(This post was last modified: 05292014 04:06 PM by Dieter.)
Post: #17




RE: [WP34s] Linear and nonlinear regression with L.R.
(05292014 01:54 PM)fhub Wrote: And as it seems also with a completely outdated manual on the WP34s Sourceforge site ... It's completely outdated indeed. The PDF offered there is named Manual_wp_34s_3_1.pdf and has 211 pages. The first page shows a 34s displaying version 3.1 3330, the footer on each page says "edition 3.1". I do not remember where and when I got it, but my current PDF manual is "Manual_wp_34s_3_2.pdf" and it has 226 pages. The first page shows a 34s displaying version 3.1 3333 and the footer on each page says "edition 3.2". So at least one newer version must have been offered for download. I wonder why at least this one is not available on Sourceforge. The current software version is different in many aspects from what the manual says, so a manual update is mandatory. You simply cannot offer current software along with a manual that reflects a version one or two years ago: the last release notes are from November resp. December 2012. Dieter 

05292014, 04:08 PM
(This post was last modified: 05292014 04:16 PM by Dieter.)
Post: #18




RE: [WP34s] Linear and nonlinear regression with L.R.  
05292014, 04:21 PM
Post: #19




RE: [WP34s] Linear and nonlinear regression with L.R.
Quote:So I guess it would indeed be no license violation (because it's GPLed) to publish my updated manual ... I don't know about this specific case (because I don't care). But in general, whoever owns the code, doc, etc. can make whatever conditions he wants. And just because the code is GPL does not mean the doc is GPL. Actually, I don't think the GPL works for doc but the GPL people do have some sort of license agreement (GNU FDL?) that they use when they want to. If the owner says you can't publish or change the doc that should be good enough to stop you in theory. In practice, he has to bring suit against you which wastes time and money and gets hard across international boundaries. I don't think enforcement is very likely. But people should still behave responsibly. You would think the authors of socalled open source or community projects would be open to receiving diffs for code and doc but really they can do whatever they want. It ain't OVER 'till it's 2 PICK 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)