Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Misc
Reload this Page Mathematics - Regression software for linux?
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Misc Any questions or Linux discussion that does not fit in any of the other technical areas.

Reply
 
Thread Tools Display Modes
Old 01-25-2008   #1 (permalink)
ionophore
Just Joined!
 
Join Date: Jan 2008
Posts: 2
Mathematics - Regression software for linux?

Hi all,

I've recently started working on a project that's requiring me to analyze large amounts of numerical data. I need to be able to fit my datasets to some fairly intricate (nonlinear) equations (polynomials, transcendentals .etc). I've been playing around with R (The R Project for Statistical Computing) but I'm not sure that it's exactly what I'm looking for. Regression seems to be a pretty small component of it and it really feels awkward to do anything that's much more than a polynomial in it (of course, it could just be that I don't fully know how to use it yet).

Does anyone know of any software that's made to do data analysis like this? On Windows there are things like Sigmaplot or Igor pro (which really are not ideal either, but they seem closer than R...).

Thanks in advance,

-Ben
ionophore is offline   Reply With Quote
Old 01-25-2008   #2 (permalink)
sdimhoff
Linux Newbie
 
sdimhoff's Avatar
 
Join Date: Jan 2007
Posts: 115
Hi Ben!

First of all, welcome to the forums.

2.) How large are these datasets which you are talking about? Size does matter for this type of thing. Since R loads data into memory, you either have to be clever with your scripting or look to another option when single datasets get above 100,000 or so. (This is not a firm number, just an example of when things start to slow down.) If your datasets are very large then you may have to switch languages. Building regression functions in something like C or fortran are necessary when this happens (Don't worry, someone else has probably already made them.)

3.) I use R daily and actually regression is a Major large part of the R picture. However, I fully realize that since R comes off as a strange jumble of S+, matlab-like utilities, perl, etc. it can be difficult to find things. Here is a link to what I think is some of the best R help around:

Regression
Other regressions

If you just go to Index of /UNIX/48_R you can see all the topics. (you may want to start with Other regressions and skip to the non-linear fitting portion)

Another big advantage of R is the easy analysis available once you've got yourself a fitted model.

4.) If you post an example of the regression you need to accomplish I can probably help you out. (or at least try then point you in a new direction...)

5.) Finally, if you do decide to use R and get confused about anything, the developers are amazingly helpful and you can just use their R-help mailing list. The other avid users/devs on that mailing list would be able to answer any R questions you could throw at them.
__________________
Linux since: 2001
Gentoo since: 2004
- - - - - - - -
Translation:
I fix things until they break.
sdimhoff is offline   Reply With Quote
Old 01-29-2008   #3 (permalink)
ionophore
Just Joined!
 
Join Date: Jan 2008
Posts: 2
Hey, thanks for all the info. I'll have to read over those references carefully.

It's good to know that R is capable of regression. I mean, you would think that it would be, but it just seems awkward to get, for example, a quadratic regression by:

quad_reg <- lm(data ~ X + I(X^2))

Seems "unnatural," like I'm using lm for something it wasn't intended to do...
ionophore is offline   Reply With Quote
Old 01-29-2008   #4 (permalink)
sdimhoff
Linux Newbie
 
sdimhoff's Avatar
 
Join Date: Jan 2007
Posts: 115
You may be having trouble for a couple of simple reasons. First of all, it seems unnatural because you are using the incorrect function to do the model fitting.

lm = linear model
nls = nonlinear least squares

There are actually several ways to skin this cat, but I think it would be best to just look to those two functions. If you can transform your function to be linear then you can use lm, and transform the fitted model back. If you can't do that, or just can't do that easily, then nls works great. Here would be an example of that quadratic:

Code:
> x = seq(from=1, to=10, by=.1)
> somedata = 4*x + rnorm(91,mean=0,sd=20) + 10*(x)^2
> plot(somedata ~ x)
> fm1=nls(somedata ~ (A*x + B*x^2), start=c(A=1,B=1))
> lines(x,predict(fm1))
> summary(fm1)

Formula: somedata ~ (A * x + B * x^2)

Parameters:
  Estimate Std. Error t value Pr(>|t|)    
A   5.9368     1.3015   4.561 1.62e-05 ***
B   9.7332     0.1671  58.238  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Residual standard error: 18.82 on 89 degrees of freedom

Number of iterations to convergence: 1 
Achieved convergence tolerance: 3.124e-08
As a side note, you can see that I've simulated data that would have some significant noise in it, but you can just substitute in whatever data you like.
__________________
Linux since: 2001
Gentoo since: 2004
- - - - - - - -
Translation:
I fix things until they break.
sdimhoff is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
JRE 6u2 XxDemoNxX SuSE Linux Help 2 09-27-2007 11:48 AM
HOWTO - Install Software [README] jasonlambert Linux Tutorials, HOWTO's & Reference Material 11 01-04-2005 11:46 PM
IceWM - can't set up a wallpaper kyku Linux Desktop / X-Windows 7 09-01-2004 06:33 PM
Older kernel install w/Mandrake 9.0 PixelSmoke Installation 18 01-15-2003 02:18 PM




All times are GMT. The time now is 06:52 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0