#### Linear Fitting

```Hello

I have a 512*256 data file.  What I want to be able to do is create a new matrix by doing the following

First, I want to calculate the linear fit equation for each row (the equation is different for each row).  Then, I want to replace every value in that row with the value stored there minus the linear fit equation, where x is just the index number for the row.  I want to be able to do this for all 512 rows, ultimately creating a whole new data set

Let me just provide you with an example so it's clear what I am asking.  So in my data file there are 256 numbers in the first row.  That first row has some associated linear fit equation.  I want to replace all these 256 numbers with the old values minus the linear fit equation.  So if a value is 10 (it's in the first row, x=1) and the linear equation is 5-x, my new value to replace 10 would be 10-(5-1) = 10-4 = 6.   Then we would just want to repeat this for every row, and every cell in each row.

I would really appreciate any help on any part or all of this.  Thank you very much for your help, I really appreciate it!!!  If I'm not being clear just let me know.  Thanks agai

Wy-Men Loh
``` 0 6/8/2004 9:56:03 PM excel.misc  78881 articles. 5 followers. 1 Replies 508 Views Similar Articles

[PageSpeed] 0

```Wy-Men
Are you saying that each row has a linear equation, say
y = f(x) where x is the column number and y is the number derived from the
linear fit equation?  Then each cell would be changed to (old value)-y?  If
so, you would need a looping macro which is fairly simple to code.
Where are the linear equations for each row?  In a list somewhere, by
row number perhaps?  Post back with more details or contact me direct at
ottomocobia97@bellsouth.net
Remove "cobia97" from this address.   HTH   Otto
"Wy-Men" <anonymous@discussions.microsoft.com> wrote in message
news:09E1CF5A-54EF-4A94-B56D-A8FD337CA84D@microsoft.com...
> Hello,
>
> I have a 512*256 data file.  What I want to be able to do is create a new
matrix by doing the following:
>
> First, I want to calculate the linear fit equation for each row (the
equation is different for each row).  Then, I want to replace every value in
that row with the value stored there minus the linear fit equation, where x
is just the index number for the row.  I want to be able to do this for all
512 rows, ultimately creating a whole new data set.
>
> Let me just provide you with an example so it's clear what I am asking.
So in my data file there are 256 numbers in the first row.  That first row
has some associated linear fit equation.  I want to replace all these 256
numbers with the old values minus the linear fit equation.  So if a value is
10 (it's in the first row, x=1) and the linear equation is 5-x, my new value
to replace 10 would be 10-(5-1) = 10-4 = 6.   Then we would just want to
repeat this for every row, and every cell in each row.
>
> I would really appreciate any help on any part or all of this.  Thank you
very much for your help, I really appreciate it!!!  If I'm not being clear
just let me know.  Thanks again
>
> Wy-Men Loh

``` 0 6/8/2004 10:35:15 PM Similar Artilces:

Migrating AD to new domain. How does Exch 5.5 fit in?
Over a weekend (hopefully) I will be migrating from one domain to another temporary domain. Then I will be taking the original domain out of it's current forest and into its own. I will then migrate back to the original domain. I'm using Exchange 5.5. What do I do with Exchange? Should I leave it with the original domain and assume that the appended SIDHistory of the users will still work correctly with it when they move back? I'm thinking this will work since it's happening over a weekend... I don't know anything about migrating Exchange 5.5 to a new domain... Any ...

Best fit lines
how do i create a best fit line graph for results in a table? thanks in advance david See Help for info on the TREND and FORECAST functions if the fit is linear, or GROWTH if exponential. If more complex fit, please tell us more best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "David White" <DavidWhite@discussions.microsoft.com> wrote in message news:C8D6B850-F188-4571-A3F6-CC6EC3ECB428@microsoft.com... > how do i create a best fit line graph for results in a table? > > thanks in advance > david David - Here are three a...

linear and exponential graphs and x,y intercepts
I have two lines one linear (y=mx+c) and one exponential (y=c^bx) and they intercept each other. I believe it is possible to calculate where the lines intercept. Although I can do this by graphing the data, it takes time and allows for user error so a calculation would speed things along greatly. The problem: So for the first line using the equation y=mx+c the numbers for the 13kPa line are y=0.0021x+9e-16 And for the exponential line (y=c^bx) which we produce to using the myograph is y=0.0022^0.0046x (^=Exp) I know that the two lines intercept at 1613. But no matter what I try I can&...

Linear Programming
In Excel how do you set up a 3 variable linear programming problem on a spreadsheet with a a number of constaints using Solver? Franklin - See the tutorials and examples at www.solver.com. Or, search your drive for the file solvsamp.xls, which is installed when Solver is installed and which has a 3-variable nonlinear example that is easily converted to linear. - Mike www.mikemiddleton.com +++++++++++++++++++ "Franklin" <anonymous@discussions.microsoft.com> wrote in message news:0c5a01c500bf\$8f5038c0\$a501280a@phx.gbl... > In Excel how do you set up a 3 variable ...

Resize frame from OleInPlaceSite to fit content f
Hi, I need to correct mfcie example to handle possible 'window.open' calls that resize the browser window. I have replaced the standard IOleInPlaceSite::OnPosRectChange method imlementation (in order to catch browser resizes) My question is what is the correct and robust way to resize all things to fit change browser size? If I could get this notification inside the view, I would probably use ResizeParentToFit, but I get it in my CCustomOleControlSite. In my current solution I don't like that the view is resizing things at an upper level, I think ther should be a way to pass si...

how to fit my column unmoved eventhough i scroll down?
how to make like for example i have column 1 until column 20 when i right scroll to column 8, it start to move to right hand side, and my first column can't see anymore. I want to be even though i scroll, the first column is not moving one.. no matter how i scroll, it can see the first column, how to set? which option? Hi - move the cursor in cell B1 - goto 'windows - Freeze Panes -- Regards Frank Kabel Frankfurt, Germany "Zxing" <Zxing@discussions.microsoft.com> schrieb im Newsbeitrag news:A6D0021C-1B95-4764-B5EC-84D91DD79F34@microsoft.com... > how to make lik...

how do I graph a linear equation?
I want to graph the linear equation y = 2x + 4 in microsoft excel. How do I do this? On my TI-83 Plus I could easily do this. I also know I could create a data table and use the table of values to chart the line in excel. But I want just enter the equation in excel and have excel graph it. Thanks. On Sun, 9 Jan 2005, in microsoft.public.excel.charting, Throstle <Throstle@discussions.microsoft.com> said: >I want to graph the linear equation y = 2x + 4 in microsoft excel. How do I >do this? On my TI-83 Plus I could easily do this. I also know I could create >a data table and ...

using linear / non linear graphs to extract results
Hi, A frequent function of my job is to analyse data on graphs/charts to extract data for engineering data , i.e power / temperature/flowrates etc etc Is the a microsoft based programe i.e. Excel/Access that is capable of understanding data on a scaled X-Y axis that if an X value was entered in a cell, the programme would extract a corresponding Y value from a line on a graph ? If anyone has any woring examples of such a thing, I'd appreciate a link Thx Hi, If there is a linear relationship between X and Y use the function FORECAST It a power series is needed use LINEST - see examp...

Linear Regression
I have five numbers in: A1,B1,C1,D1,E1 Is there a function that will give me the linear regression of those numbers that can be put in D1, with charting etc? TIA Linear regression works with ordered pairs. row 1: 1,2,3,4,5 row 2: 2,4,6,8,<formula> formula in E2 : =FORECAST(E1,A2:D2,A1:D1) will return 10 Any use? best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "Saxman" <john.h.williamsREMOVETHIS@btinternet.com> wrote in message news:XpidnXpInZMDMx7WnZ2dnUVZ8m1i4p2d@bt.com... > I have five numbers in: &...

Linear Equations
I am having difficulty graphing a linear equation in two variables by using three ordered pair 1/2 y = 2x + My ordered pair x 0 1 y 2 6 10 see as follow Pairs x (0, 2 (1, 6 (2, 10 I am unable to graph this problem and need help!!! Just select the range containing the ordered pairs and Insert|Chart. Jerry Angela Mitchell wrote: > I am having difficulty graphing a linear equation in two variables by using three ordered pairs > > 1/2 y = 2x + 1 > > My ordered pairs > x 0 1 2 > y 2 6 10 see as follows > > Pairs: > x y > (0, 2) >...

linear increments
Hi, I am kind of new to excel and was wondering if excel is capable of doing linear increments. I want increments that can vary, meaning in one case i want to go from 0 to 10 in increments of 2 and in other cases i want to go from 0 to 10 in increments of 5. The number of cells change. Is it possible for excel to do this w/o having to specify the number of cells needed? -- NewGuy100 ------------------------------------------------------------------------ NewGuy100's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=27935 View this thread: http://www.excelforum.com...

Excel 2007; graph the best fit line from a regression analysis?
Try using this white space to ask you question with a bit more detail best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "mattz" <mattz@discussions.microsoft.com> wrote in message news:574CCC66-72EA-44D0-8D36-2147B6C7C279@microsoft.com... > ...

Graph two linear inequality equations
So the question is..... Any help or guidnace or direction to a web page from the gurus would be appreciated for getting it into excel so I can have a pretty graph. I can solve this with a stuby pencil and paper. Easy enough to get the X and Y coordinates. How do you put it into excel to graph? I looked online and find examples, but the more I look the more confused I get. 400j + 250X <= 20,000 (j=0 and x= 80) (j=50 and x =0) straight line 40j + 30X <= 2,160 (j= 0 x = 72) J = 54 X = 0) straight line j >= 0 x >=0 (0,72) X220 = 15,840 (54,0) X320 = 17,280 An electronics ...

best fit line
I have a line graph with 6 series plotted (I.e. 6 different lines--sales on y, months of x). How do i add a best fit line to the chart? When i select Add Treanline, it only lets you select one series (and I'm assuming the result you get is a linear y=mx+b line....i 'm looking for the best fit line for serveral series... Thanks. jeremy -- Message posted via http://www.officekb.com since it is a line chart, there are several things you could try. If it is justified, you could generate an average of the data points for each x point and plot it. Make a trend line of the average th...

Linear Optimization
how can I optimize with integer variables? Assuming you are using Solver, add a constraint that specifies the variables to be 'Int' (w/o the quotes). -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <E214DF54-5098-41E1-9DD9-74DD53017D30@microsoft.com>, FaranakNegahdar@discussions.microsoft.com says... > how can I optimize with integer variables? > ...

HTML table too big to fit on page is lost
Hi I need to insert some HTML-formatted text into a word document. I save the HTML as a file and then use InsertFile to get it done. It works great, except when I run into a table that is too big (too many rows) to fit on one page. When that happens the table is cut short upon reaching the end of the page, rather than continuing on the following page. Is there some additional option I'm missing, or is it simply impossible? Below is my file inserting code: object _start = 0; object _end = 0; object ConfirmConversions = false; object Link = false; object Attachment ...

forced linear regression
Hello, I have a dataset with a (straight) line fit to it (with regression value and everything). My question is how do I take line with a different slope and force fit it to my data and optimise this new fit (i.e. get a new, obviously smaller, regression value that's a maximum for the forced slope with my data)? It's sort of the opposite of forcing a line through zero, I think. Anyway, is it possible, and if so where do I go to find out how to do it? I think you have to do it the old fashioned way. Attached is a example. If you don't have 'Solver...' on y...

Best fit data from a best fit curve?
MS Excel 2003. I have followed the instructions to apply best fit curve to my raw data points. I have a best fit curve that I am happy with, and I now need to extract the corresponding actual best fit data from the curve for use in other software applications. Does someone know how? Hi, See Bernard's page, which also includes a link to Tushar's page. http://people.stfx.ca/bliengme/ExcelTips/Polynomial.htm Cheers Andy Gigi wrote: > MS Excel 2003. I have followed the instructions to apply best fit curve to > my raw data points. I have a best fit curve that I am happy w...

Linear Line
Firstly, apologies as this will appear twice. I sent it via Google and they said it'll be 3-8 hours before posted, now if I had 3-8 hours that'd be useful! My question: I have 8 sets of x,y coordinates, is there a function that can tell me if all points are linear (i.e. form a straight line). Thanks in advance Mike Do your own google searches with Ron's add in http://www.rondebruin.nl/ -- Don Guillett SalesAid Software Granite Shoals, TX donaldb@281.com "Mike" <mrskowse@hotmail.com> wrote in message news:vhvm1693cg7400@corp.supernews.com... > First...

"fit to page" option in word 2007?
is there a "fit to page" option in word 2007? You can use the Shrink One Page option which is available on the ribbon when you switch to Print Preview. For more on copy fitting, see http://word.mvps.org/faqs/formatting/FitCopy.htm. -- Stefan Blom Microsoft Word MVP "Millie" <Millie@discussions.microsoft.com> wrote in message news:7A63B53F-05B4-4215-8421-5D780B7FA011@microsoft.com... > is there a "fit to page" option in word 2007? The option is on the ribbon associated with Print Preview - 'Shrink One Page' -- &l...

linear interpolation
Hi, I have a set of data that has monthly (or sometimes biweekly) measurements. However, I need to interpolate the daily values using the actual consecutive data. However, I do not want to put a best-fit line or curve through the data for the whole year. I want the program to pick between two consecutive values, and depending on their relationship (linear increase or decrease), fill in the gaps between them and spit out the corresponding values. For example, I have the following set, Date Value Jan. 10 0 Jan. 15 5 what I need is this: Date Value Jan. 10 0 Ja...

X Axis Linear Representation Problem
I have a project involving a hiking trail where I am trying to capture altitude on Y axis versus mile marker location on X axis. I can enter the data in adjoining columns and use the chart wizard but each mile marker value gets positioned along the X axis in uniform increments rather than an actual linear scale representation. In other words, mile markers 3.3 and the next mile marker (3.8) are the same distance apart on the X axis in the graphic representation as is marker 3.8 and the next one (12.5). This distorts the graphic representation of the actual linear distance between the...

How do I enter a quadratic and cubit-fit equations?
I have a data set the I want to evaluate using quadratic and cubit fits- can someone provide the proper equations? Adn what about plotting the funtions? 1) read Help to learn about Trendlines - make an XY chart first 2) visit my site to learn about LINEST to find polynomial coefficients http://www.stfx.ca/people/bliengme/ExcelTips/Polynomial.htm 3) to lean about charting - buy a book or visit http://peltiertech.com/Excel/ChartsHowTo/index.html best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "DianeD" <DianeD@discussions.microsoft.com> wr...

line of best fit
can i get excel to draw a line of best fit yes "junior" <junior@discussions.microsoft.com> wrote in message news:C04ED822-2BBE-4BCD-AD1C-5A20DE15AD59@microsoft.com... > can i get excel to draw a line of best fit Yes. Make sure the Analysis ToolPak is added-in and read help on LINEST -- Gary''s Student "junior" wrote: > can i get excel to draw a line of best fit right-click the series and choose Add Trendline. Bob Umlas Excel MVP "junior" <junior@discussions.microsoft.com> wrote in message news:C04ED822-2BBE-4BCD-AD1C-5A20D...

Linear Fitting
Hello I have a 512*256 data file. What I want to be able to do is create a new matrix by doing the following First, I want to calculate the linear fit equation for each row (the equation is different for each row). Then, I want to replace every value in that row with the value stored there minus the linear fit equation, where x is just the index number for the row. I want to be able to do this for all 512 rows, ultimately creating a whole new data set Let me just provide you with an example so it's clear what I am asking. So in my data file there are 256 numbers in the first row. T...