How do i find where 2 best fit lines cross?

Hi
I was wondering if anyone knows a way to find where 2 best fit lines cross, I don't have the equation for the lines and i'm not sure if I can get it.
I currently have the program tracing the lines and comparing y values however it will only increment in steps of 0.1 on the x-axis and i need an accuraccy of 0.0001

If you have or can get a series of XY value pairs for both of the lines, getting the equation of the line is as simple as calling Linear Fit.vi.  Once you have the equations of both lines, the intersection is simple algebra, subject to the accuracy of your fit.  If the XY data pairs describe a curve, not a line, and you want more accuracy, you can try a polynomial fit using General Polynomial Fit.vi.  To find the intersection, set one polynomial equation equal to the other, compute the coefficients of the resulting polynomial equation, and find the root using Polynomial Roots.vi.  All this assumes you have a Pro or better version of LabVIEW.  If you don't, you can still do it, but you will need to write some code for the fits and roots.  Check out a copy of Numerical Recipes in C, by Press et. al. from your local library and it will give you the equations for all the above.  With LabVIEW's native matrix handling capabilities, the rest is straighforward.
Let us know if you need more help.
This account is no longer active. Contact ShadesOfGray for current posts and information.

Similar Messages

  • How do I make a best fit line on a scatter plot?

    I have a set of data and I made a scatter plot on numbers, but how do I put a best fit line in there?

    select the graph, then open the Charts Inspector.
    Open the series section (from the options at the top "Chart", "Axis", "Series"), Then select the "Trendline" in the "Advanced" section near the bottom.  Finally select the type of trendline

  • Best fit line

    regarding a graph made from spreadsheet data...
    how do i make a best fit line to a set of points?
    also, is there a way to find the slope and intercept of this line?
    Thank you!

    Hello
    The named functions are not available in AppleWorks.
    One way to mimic them is to use AppleScripts .
    Here is an old one which calculate the slope.
    --{SCRIPT}
    tell application "AppleWorks 6"
    activate
    tell front document
    set laSelection to get object specifier of the selection
    set debutCible to name of first cell of laSelection
    -- nom de la première cellule cible
    -- • name of first dest cell
    set premColonne to item 1 of (index of first column of laSelection) as list
    set premRangee to item 1 of (index of first row of laSelection) as list
    set dernColonne to item 1 of (index of last column of laSelection) as list
    set dernRangee to item 1 of (index of last row of laSelection) as list
    set nb_Rangees to dernRangee - premRangee + 1
    if not (dernColonne - premColonne) = 1 then error 8088
    set cell11 to name of row premRangee of column premColonne
    set cell12 to name of row dernRangee of column premColonne
    set cell21 to name of row premRangee of column dernColonne
    set cell22 to name of row dernRangee of column dernColonne
    set vX to get select (cells cell11 thru cell12)
    set the clipboard to vX
    set vY to get select (cells cell21 thru cell22)
    set nb to count of vX
    set {X, Y, XY, x2} to {0, 0, 0, 0}
    repeat with i from 1 to nb
    set xi to vX's item i
    set yi to vY's item i
    set X to X + xi
    set Y to Y + yi
    set XY to XY + (xi * yi)
    set x2 to x2 + (xi * xi)
    end repeat
    set slope to (XY - (X * Y) / nb) / (x2 - (X * X) / nb)
    select menu item 4 of menu 3 (* copier *)
    set slope to my calcule(nb_Rangees)
    display dialog "" & slope
    end tell
    end tell
    on calcule(nb_)
    tell application "AppleWorks 6"
    activate
    set AWversion to (version as text)
    select menu item 2 of menu item 1 of menu 2 (* Nouveau tableur
    • New spreadsheet *)
    tell front document
    select cell "A1"
    select menu item 5 of menu 3 (* Colle • Paste *)
    set formula of cell "C1" to "=A1*B1"
    set formula of cell "D1" to "=A1^2"
    select cell ("C1..D" & nb_)
    select menu item 3 of menu 5 (* Recopier vers le bas
    • Fill down *)
    if AWversion starts with "FU1-" then
    set formula of cell "E1" to "=(SOMME(C1..C" & nb_ & ")-SOMME(A1..A" & nb_ & ")*SOMME(B1..B" & nb_ & ")/NOMBRE(A1..A" & nb_ & "))/(SOMME(D1..D" & nb_ & ")-SOMME(A1..A" & nb_ & ")^2/NOMBRE(A1..A" & nb_ & "))"
    else
    set formula of cell "E1" to "=(SUM(C1..C" & nb_ & ")-SUM(A1..A" & nb_ & ")*SUM(B1..B" & nb_ & ")/count(A1..A" & nb_ & "))/(SUM(D1..D" & nb_ & ")-SUM(A1..A" & nb_ & ")^2/count(A1..A" & nb_ & "))"
    end if
    set slope_ to cell "E1"
    end tell
    close document 1 without saving
    end tell
    return {slope_}
    end calcule
    --{/SCRIPT}
    Yvan KOENIG (from FRANCE mercredi 1 août 2007 06:51:46)
    edit:
    When I edit my message, the script appears but when I look in the forum it doesn't appear.
    It appears that it is a recent "feature" of this forum;
    I made a last attempt.
    If it doesn't work, you may send a mail to
    koenig then a dot then yvan then an @ then tele2 then a dot then fr
    I will send you the script as a mail attachment.
    Yvan KOENIG (from FRANCE mercredi 1 août 2007 07:07:17)
    Message was edited by: KOENIG Yvan

  • Best fit lines for loops and sine waves

    I am trying to find a best fit line that will work for sine waves and loops (hysteresis loops). I can get the sine wave just fine, but when I switch to a hysteresis it just puts a line across the middle (I assume because of the 2 y values for every x). I am doing data acquisition that will take in both forms and graph them. I tried a polynomial fit and it doesn't work at least the way I implemented it and I tried a few others but it looks like they are all function based. Also, my y values are coming out of a Bessel filter. I don't think this would be affecting anything but I thought I would put it in here incase it does.
    Did I miss one that I haven't tried that works for my application?
    Thanks
    Patrick

    RiversDaddy wrote:
    ... currently I am doing it by looping and reducing the error towards zero to fit the amplitude and phase. (I know the frequency).  If this is what you are looking to do then I will help, or should I be doing things differently? All of the functions I have found to filter or extract tones seem to introduce a larger frequency of phase error than i get using this method, but am I missing something?
    "looping" is a bit vague. What is the actual algorithm to find better estimates (e.g. levenberg marquardt, etc.)
    What problems did you have with extract single tone. Can you show some data where the results from it are not good?
    LabVIEW Champion . Do more with less code and in less time .

  • Is it possible to apply a best fit line to charts?

    The topic pretty much says it all, I have a scatter chart that I need to apply a best fit line to in order to make a general slope assumption. Is it possible to do this, and if so how?
    Also, I can't seem to put a label on my X and Y axis'. I have the number increments that I need, but I need to give them a name. For example, the x-axis needs to be Volume in mL and the y-axis needs to say Mass in grams. Is it possible to do this?
    Thanks very much in advance to anyone who can help.
    Daniel

    The charting function in the iWork suite is fairly rudimentary -- there is no functionality for doing regression or best-fit lines, and the axes labels have to be created by hand.

  • "best fit" lines

    I have a basic line graph that shows the spending $ trend of three business units over time (5 year history at month level). I'd like to add "best fit" lines to make it easier for end users to discern the trend without all the hills and valleys. How do I accomplish that in 11g? I haven't seen any graph that adds this by itself, so I'm assuming I need to calculate a new "best fit" metric or something?
    Thanks,
    Scott

    Here's a visual example. Column C creates a 3-point moving average that is plotted along with the data values. I'll send you the example. You can create any equation that you'd like depending on your use.
    Regards,

  • I have rented a movie on my ipad. It did not download due to not being on wifi at the time.  I know I completed the rental because my gift card balance went down $3.99 plus tax.  How do I find where to download the movie?

    I have rented a movie on my ipad. It did not download due to not being on wifi at the time.  I know I completed the rental because my gift card balance went down $3.99 plus tax.  How do I find where to download the movie?

    But now I can't find the actual movie...I go to iTunes to purchases and view movies , to downloads and searched the title of the movie...I can see an icon of it and it is in a separate place from other purchases but it says downloaded in faded lettering. Where is it?
    If you can't find the movie you downloaded on your iPad, iPhone or iPod Touch, check inside your Videos App

  • I've "successfully" installed the latest version of Flash Player. How do I find where it "lives" so that I'm certain it's in there. Also, do I put the App icon in the trash now? (I am on a Mac) Thank you!

    I've "successfully" installed the latest version of Flash Player, as recommended by Firefox. How do I find where it "lives" so that I'm certain it's in there. Also, do I put the App icon that appears on my desktop, in the trash now? I am on a Mac and I am not technically inclined.
    Thank you!

    Your list of plugins shows that you have installed Flash 10.2 r152 which is the current release version.
    You can also confirm that Flash is installed by visiting this link - http://www.adobe.com/software/flash/about

  • How do you find the number of lines in a file?

    I need to count how many lines there are in a file, I am using a BufferedReader to read in the data, but how can I find the number of lines?
    Thanks

    That depends. How do you define a line? Is it a specific number of
    characters, a String that's terminated by a newline character or some
    combination thereof?

  • Log scale of the axis and the best-fit line

    I try to plot a graph and set the scale of the x-axis to log scale and then i try to plot a linear trendline (best fit line). but the linear trendline does now show on the graph. but if i set the axis scale to linear, then the trendline does show.  i will need my graph in the log scale and also a linear best fit line. please help me out

    0
    100
    3.00E-09
    71.52
    1.00E-08
    57.3
    3.00E-08
    39.15
    1.00E-07
    24.13
    3.00E-07
    14.77
    1.00E-06
    7.22
    i meant you these data, and left column is x-axis and gonna use log scale for the axis. the right column is the y axis. and then i need a best fit line for this graph.. hope you can help me

  • Best fit Line on scatter chart

    Hi,
    I am trying to draw best fit line over two points using the formula y=mx+c.
    I have the following data,
    consider x=68, y=23 and a=82, b=30
    I interchanged the above values and form the points to plot
    basically using the above (x,y,a and b) I constructed (x,y),(a,y),(x,b) as points to plot.
    68,23 (x,y)
    82,23 (a,y)
    68,30 (x,b)
    I created a scatter chart based on the value, Now I want to draw the line only between (a,y) and (x,b).
    Is this achievable using any other chart or ways?
    Any help highly appreciated.
    Thanks,
    Vino

    Hi,
    Any input on this please.
    Thanks,
    Vino

  • Is it possible to show a best fit line

    i am plotting percent fructose V.S density and trying to do a best fit line. A connect the dots jagged line would not be appropreate. Is it possibleto do this?

    Short answer: No. Wait to see what the next version brings. The only real work-around is to add a data set using the same x values and new y values, predicted from the linear regression. You would then have to draw a line over the resulting plot points manually. Then, "hide" the extra data set by eliminating the data point fill and outline.
    Only help I can offer is to look in your Utilities folder for an app named "Grapher." It can do everything you ask (and then some) and also produces high quality graphs as well (which can be copied and pasted into other apps in a variety of formats). Best of all, it's free and you probably already have it. It plots both discrete data sets as well as true functions. And yes, it will do linear regressions (and power, exponential, polynomial, and "custom" ones as well).
    Unfortunately, iWork's charting abilities are best described as "laughably pathetic." In stead of revolutionizing the charting aspect of spreadsheets, Apple chose to follow in M$'s footsteps, aka the path of a sado-masochistic CPA or "the Excel way." In essence, Numbers is only capable of producing what I call "bin count" charts (as in pie charts, bar graphs, and line/area charts). The "scatterplots" Numbers produces are really a hacked version of bin count charts. As such, they are basically useless for real scientific/engineering/mathematic plots. In fact, it does them so badly, I'm surprised the "scatterplot" option even made the cut for the final release.
    Things that breaks/cripples Numbers' "scatterplot":
    • No control over range of axis. "Value Axis Format" controls don't function properly/always remain blank and there is only one set of values for both axis (just like a bin count chart, whose "x axis" has no real, numerical value; so, doesn't need any controls). And there is no way to lock the scale of the axis so, for example, 10 units on the x axis is the same physical distance as 10 units on the y axis.
    • Axis grid divisions are only allow to be integers between 1 and 10 (which only makes sense for a bin count plot).
    • No 3D, log, log-log, ln, ln-ln, cylindrical, or spherical plots.
    • No true function plots. And there is no way to connect points, it only plots discrete data sets.
    • No control of data point marker sizes, only the fill/outline color and outline thickness.
    • Chart legend gets it's text from the independant variable (aka x values) column title, not the dependant (y value) column title, like it should. (Something that only makes sense on a bin count chart, which usually only have one column of data per data set.)
    • Each data set must come from adjacent pairs of columns. (You can't have one set of x values for a table of multiple y values.)
    • No way to control the size of the plot area itself (only the overall size of the chart rectangular area, which includes the axis text). So you can't fake a line chart as an overlay over a scatterplot, there's no way to align them.
    • Only does linear regressions directly (and then you have to put it together from pieces). No exponential, log, ln, power, or polynomial fits.
    • Charting brings Numbers to it's knees as far as speed is concerned.
    • I haven't found a way to ADD a data set to chart, it always seems to replace the data already plotted (or am I missing something or fighting a bug?).
    Heck, there isn't even error bars on it's financial charts, so you can't even do a simple high-low-close stock price tracking, line chart. Other than that, it you want a 2 1/2D pie chart with wood grain texturing, Apple's got you covered!
    Scott
    P.S. Just in case those of you reading this think I'm an Apple/Numbers hater, you couldn't be more wrong. I'm a huge fan of Numbers and it has permanently bumped Excel off of my dock. (I just don't use it for charting.) I call'em like I see 'em. And Apple can't fix it if they don't know it's broken.

  • Other lines parallel to a Best fit line on a scatter graph?

    Can you put Lines of equal gradient to the best fit line on a scatter graph going through to points furthest above and below the best fit line?

    Simplified a bit so I am not so ashamed
    I2=SLOPE(C2:C9,B2:B9)
    I3=INTERCEPT(C2:C9,B2:B9)
    Y Linear (column D) =$I$3+B2×$I$2
    Y - YLinear (column G) is what it says
    Max Line (column E) = $D2+MAX(G)
    Min Line (column F) = =$D2+MIN(G)
    You have to format the "trend" lines with connecting lines and no data symbol

  • Is it possible to do best fit line in chart in numbers

    is it possible to do best fit line in chart in numbers

    Hi R,
    This is a Scatter Plot in Numbers 3.1. Data are in Body Columns, not Header Columns.
    Click on the chart, then Format Panel > Series > Trendlines
    Choose a Trendline. You may click on Show Equation and Show R2 (R squared).
    Regards,
    Ian.

  • TS4006 How do you find where your Iphone was last located before powering off?

    How do you find where your Iphone was last located before powering off?

    Hi Mr. Wayans,
    Here is a support article with the information you are looking for:
    http://support.apple.com/kb/PH2698
    Cheers,
    GB

Maybe you are looking for

  • Usb-harddisk can´t include in time machine backup

    Hello, I have a problem including a 2 TB USB Harddisk (Fat32 formatted) with one volume. With OS Lion, it is no problem to read/write on it. But, it is not possible to include the volume (384 GB data written on it) to time machine. It appears, but it

  • How to access "Insert Bar" by keyboard in Dreamweaver CS5.5

    Hi All, Now I need to support Section 508 compliance, but I don't find how to access "Insert Bar" by keyboard. For Examlpe: The focus be in "INSERT", but it doesn't move to other operations(red color) by keyboard.  Could you help me to resolve the pr

  • If I close Firefox, I can't open it again without rebooting. It says that Firefox is still running.

    I have Firefox 6.0.1. I am running it on a desktop with Windows XP. I have always loved it and need it for one program I use a lot. Lately, if I close Firefox for any reason, I can't open it back up without rebooting. It says Firefox is still running

  • Import a application In sharepoint 2010

    I Have a exported application in my  c drive  in a folder . I want to import it to a new web application . how can  i achieve this I tried using  management shell  like : import-spweb http: //  path:c:\path name but its throwing an error  like. impor

  • Signatures in Mail 6 - OS X Mountain Lion.

    Hi everyone. As you may know, Mail 6 gives you the choice to place your signature above or below the "quoted text". Ok. Now (with the option above siabled, as in the picture) when I directly mail a link by pressing cmd-shift-i there's the place where