From round robin to best-fit

Hi all,
I am trying to develop a mechanism to know which machine can handle a user job (by providing his Requirements) for now I wrote this method but it is a Round robin, I am trying to modify it to a best-fit algorithm can anybody give me tips about how should I begin?
public static String canDo(Resources userReq,Hashtable hash){
                //getResourceInfo() is a method that store the machine name
               //and thier resources(cpu,memory,disk) in a hashtable
         Hashtable resourceInfo = connectData.getResourcesInfo();
         Enumeration en = resourceInfo.keys();
         String status ="";
         String machineName;
          Resources machineRec;
        while(en.hasMoreElements()) {
                 machineName = (String)en.nextElement();
                 status = "the following machine has been allocated to you: "+machineName;
                 //resourc
                 machineRec = (Resources)resourceInfo.get(machineName);
                 if(machineRec.getCpu().getCpuIdle()>=userReq.getCpu().getCpuIdle())
                 if(machineRec.getMemory().getFreeMemory()>=userReq.getMemory().getFreeMemory())
                 if(machineRec.getDisk().getFreeSpace()>=userReq.getDisk().getFreeSpace()){
                      break;
         return status;
    }

you mustn't have seen the replies here
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=1&t=016520

Similar Messages

  • I am looking to make the switch from pc to mac and have been eyeing the MBP 13". I would like to know whether it is fine to add RAM and SSD myself? any compatibility or warranty problems? what brand/type of RAM and SSD is the best fit? thank you.

    i am looking to make the switch from pc to mac and have been eyeing the MBP 13". I would like to know whether it is fine to add RAM and SSD myself? any compatibility or warranty problems? what brand/type of RAM and SSD is the best fit? thank you.

    Chamar wrote:
    I'm possibly wrong here but I suspect opening a brand new MBP to add parts yourself will void the warranty.  It is probably in the small print.  I certainly would not risk it for an expensive Apple product.
    Some (Windows) laptops have easy access to memory and disk slots that do not necessitate taking the complete back cover off.  However, Apple does not make life easy for you.
    However, if you are going for a 'used' machine it is probably worth a try.
    Not possibly, definitely wrong, Ram and Hard Drive are considered user replaceable and will not void the warranty if changed.

  • Adjusting IOPS for Round Robin from 1000 to 1.

    We have an HP Blade Chassis that we recently moved from 4G San to 8G San.  We have a particularly chatty & repetitive application.  The application vendor has some delays with rewriting the code to be more efficient.  We are on a much bigger install than what they are accustom to.
    To alleviate some of their issues, our storage vendor recommended that we modify our round robin change rate from the default 1000 to 1.   (EMC, we have the VMAX 40)
    This isn't the only application on this cluster and it is in the process of growing.
    VMware KB: Adjusting Round Robin IOPS limit from default 1000 to 1
    While it worked great for this application, I want to know if there are any possible downsides to doing this?
    I know that it is not recommended for Microsoft clustering - which we don't use.
    But how about Oracle RAC? 
    Why would the default be at 1000 anyway? 
    Thanks - Nancy

    Ernie, the photos are captured by Canon XTi so they are in CR2, saved to my internal HD and then "loaded" to Aperture as referenced files.
    As for PS CS3, I am not sure whether I have it set up as a scratch disk or not (if you could let me know where to check it).
    Yesterday, I did yet another round trip and found out that when I finish in PS and SAVE and CLOSE, then the file shows up properly in Aperture. What I was doing before was I SAVEd if but did not close. Then I would SAVE AS in PS to make sure I have some kind of a version of the file if the one in Aperture fails to work.
    So it seems I cracked it but I would still like to hear what you have to say, or anyone for that matter. It seems to me that the SAVE-CLOSE is crucial.

  • Line of Best Fit / Linear Regression

    I am trying ot get a line of best fit for a set of data in oracle
    Lets say i have the following dataset.
    Since there are a lot of 0 in the Terms I would like to ignore those Terms
    Only use the Terms which have values to get a line of best fit.
    Any help will be appreciated.
    Thank you.
           TERMS            Count
    TERM_0801     78
    TERM_0802     58
    TERM_0803     0
    TERM_0804     82
    TERM_0805     0
    TERM_0806     0
    TERM_0807     32
    TERM_0808     0
    TERM_0901     92
    TERM_0902     0
    TERM_0903     0
    TERM_0904     56
    TERM_0905     0
    TERM_0906     0
    TERM_0907     0
    TERM_0908     0
    TERM_1001     85
    TERM_1002     0
    TERM_1003     0
    TERM_1004     67
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    Edited by: Chloe_19 on Jul 24, 2012 11:14 PM

    Argh, i wonder about the values i got, different from what excel says ;-), till you came up with your solution.
    They changed the order of the paramters from that what i consider as common:
    "expr1 is interpreted as a value of the dependent variable (a y value), and expr2 is interpreted as a value of the independent variable (an x value)."
    Do they also have left-hand traffic in the new world?
    However, didnt OP wanted to have the zeros eliminated before the calculus?
    with data as
    select 'TERM_0801' t, 78 y from dual union all
    select 'TERM_0802', 58 from dual union all
    select 'TERM_0803', 0 from dual union all
    select 'TERM_0804', 82 from dual union all
    select 'TERM_0805', 0 from dual union all
    select 'TERM_0806', 0 from dual union all
    select 'TERM_0807', 32 from dual union all
    select 'TERM_0808', 0 from dual union all
    select 'TERM_0901', 92 from dual union all
    select 'TERM_0902', 0 from dual union all
    select 'TERM_0903', 0 from dual union all
    select 'TERM_0904', 56 from dual union all
    select 'TERM_0905', 0 from dual union all
    select 'TERM_0906', 0 from dual union all
    select 'TERM_0907', 0 from dual union all
    select 'TERM_0908', 0 from dual union all
    select 'TERM_1001', 85 from dual union all
    select 'TERM_1002', 0 from dual union all
    select 'TERM_1003', 0 from dual union all
    select 'TERM_1004', 67 from dual
    select
    round(regr_slope(y,x), 4) slope
    ,round(regr_intercept (y, x) , 4) intercept
    ,round(regr_r2(y,x), 4) best_fit
    from (
    select
      row_number() over ( order by t ) x, y
    from data
    where
    y!=0
    SLOPE INTERCEPT BEST_FIT
    .4762 66.6071 .0035 regards
    Edited by: chris227 on 25.07.2012 04:58
    Edited by: chris227 on 25.07.2012 05:10
    best fit added

  • Round Robin was not happening for my cluster with WebLogic Proxy Plugin

              Hi,
              I configured my cluster with software load balancer, HTTPClusterServlet. By default,
              it is load balancing with Round Robin Algorithm. That means one HTTP request
              goes to server1, and the other HTTP request goes to server2. However, it is not
              what I can see no matter for the requests in one HTTP session or not.
              Say I open two browser, and log into my application with two different users,
              one is "cyang", the other is "xpression". Then the HTTP request (for servlet/jsp)
              from two browsers always go to the same server1, server2 is not invoked at all.
              I did see one time, with only one session (one browser with "xPression" user log
              in), the most requests go to server1, suddenly I am brough into log in page, then
              I noticed that the request for "xPression" moved to server2 although server1 is
              still alive. Therefore, at most, I can say it is "Random", rather than "Round
              Robin".
              What is the real meaning for HTTP servlet/jsp load balancing algorithm? Does
              Round Robin mean request go to each server in turns? Does it have to be different
              session or it can be within one session?
              

    It should be sticky. If not, then bug / config error.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "Carole Yang" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Thanks. Yeh, with two kind of browsers, I do see the request goes to
              different
              > servers.
              >
              > That goes back to the original question. Does "Round Robin" here fall
              into the
              > scope of a HTTP session. However, that is not always true for my tests.
              Sometimes,
              > HTTP request just randomly goes to another server while in the same HTTP
              session.
              > It is not sticky to one particular server during one session.
              >
              >
              >
              > --Carole
              >
              >
              > "Cameron Purdy" <[email protected]> wrote:
              > >Has to be different sessions to go to different machines.
              > >
              > >Best way to test is to run one session in IE and the other in Mozilla
              > >or
              > >Netscape.
              > >
              > >Peace,
              > >
              > >Cameron Purdy
              > >Tangosol, Inc.
              > >http://www.tangosol.com/coherence.jsp
              > >Tangosol Coherence: Clustered Replicated Cache for Weblogic
              > >
              > >
              > >"Carole Yang" <[email protected]> wrote in message
              > >news:[email protected]...
              > >>
              > >> Hi,
              > >>
              > >> I configured my cluster with software load balancer,
              HTTPClusterServlet.
              > >By default,
              > >> it is load balancing with Round Robin Algorithm. That means one HTTP
              > >request
              > >> goes to server1, and the other HTTP request goes to server2. However,
              > >it
              > >is not
              > >> what I can see no matter for the requests in one HTTP session or not.
              > >>
              > >> Say I open two browser, and log into my application with two different
              > >users,
              > >> one is "cyang", the other is "xpression". Then the HTTP request (for
              > >servlet/jsp)
              > >> from two browsers always go to the same server1, server2 is not invoked
              > >at
              > >all.
              > >>
              > >> I did see one time, with only one session (one browser with "xPression"
              > >user log
              > >> in), the most requests go to server1, suddenly I am brough into log
              > >in
              > >page, then
              > >> I noticed that the request for "xPression" moved to server2 although
              > >server1 is
              > >> still alive. Therefore, at most, I can say it is "Random", rather
              > >than
              > >"Round
              > >> Robin".
              > >>
              > >> What is the real meaning for HTTP servlet/jsp load balancing algorithm?
              > >Does
              > >> Round Robin mean request go to each server in turns? Does it have
              > >to be
              > >different
              > >> session or it can be within one session?
              > >
              > >
              >
              

  • Round robin DNS for load balancing between multiple network adapters (Xserve)

    I'm attempting to use 'round robin' DNS to load balance between the two ethernet adapters of an Xserve.
    Both ethernet adapters are connected to the same LAN and have static IP addresses of 192.168.2.250 and 192.168.2.251.
    The DNS zone for the server's local domain/host (macserver.private) has a machine record with both IP addresses (set up in the Lion Server UI).
    Having read up on round robin DNS, I would have expected DNS requests for 'macserver.private' to be answered with the two IP addresses ordered at random, achiving my aim of requests being served at random via each ethernet adapter.
    However this doesn't seem to be the case. Doing a 'nslookup' from any of the network clients results in the two IP addresses being listed in the same order everytime. And pinging 'macserver.private' only ever results in a response from the same address.
    Does anyone know why this is the case? Does Lion Server use a non-standard DNS configuration? Are there any additional settings I need to configure in Lion's DNS server to make adopt a round robin approach to responding to requests?
    Thanks in advance for any help!

    Be careful what you wish for
    Round Robin DNS is rarely the best option for 'load balancing'. At the very least it's subject to caching at various point on the network - even at the client side, once the client looks up the address it will cache that response - this means that subsequent lookups may be served from the client's cache and not refer back to the server. Therfore any given client will always see the same address until the cache expires.
    I suspect this is what you're seeing.
    You can minimize this by setting a lower TTL on the records. This should result in the response being cached for a shorter period, meaning the client will make more requests to the server, with a higher change of using the 'other' address.
    However, you're also going to run into issues with the server having two interfaces/addresses in the same LAN. This isn't recommended.
    As Jonathon mentioned, you may be better off just bonding the two interfaces. This will provide an automatic level of dynamic load balancing without the latency of DNS caches, as well as automatic failover should one link fail (as opposed to round robin DNS which will cause 50% of requests to fail until the client cache expires and a new lookup is performed (and, even then, there's still a chance the client will try to use the failed link).

  • NLS Redundancy using DNS Round Robin

    Hello, I have searched the internet and this forum for my question but I couldn't find the answer anywhere.
    Would it be an option to use DNS Round Robin as a 'fail over' mechanism for the DA NLS Server?
    To explain our situation a little: We have a few branch offices and it happens sometimes that the site-to-site VPN tunnel between the branch office and the main office breaks (e.g. internet outage in the main office). In those situations it would be best to
    have a NLS server in another office to prevent users from losing conenctivity to the network because of the first NLS server being unreachable (we have a full-mesh network between the offices).
    But how does the DA mechanism respond to a DNS result with multiple IP addresses when querying for the NLS server? Most browsers will go to the 2nd IP address in case the 1st IP address is unreachable in such a situation. Will DirectAccess also do this?
    I hope I explained our situation and question OK.

    Jason,
    I may have found something else. Apparently netmask ordering uses a default subnet mask of /24 (255.255.255.0) This is why the subnet must match. Apparently you can change the netmask used by netmask ordering:
    Description of the netmask ordering feature and the round robin feature in Windows Server 2003 DNS
    http://support2.microsoft.com/kb/842197
    Not every customer may use this solution, but it might provide an solution for some customers. It all depends on their address scheme. Allow me to explain...
    Imagine you have one datacenter and three branch offices. Each branch office owns a /16 subnet:
    - Datacenter (10.100.0.0/16)
    - Branch Office 1 (10.110.0.0/16)
    - Branch Office 2 (10.120.0.0/16)
    - Branch Office 3 (10.130.0.0/16)
    Of course the whole /16 sunnet is not used on a site, intead multiple VLAN's with a /24 subnet are used at each site. A VLAN for servers and clients.
    Now imagine you have an NLS in each server VLAN at each site. You configure RR for those NLS. If you query from a server next to an NLS, that NLS will be on top of the DNS query result. if you query from a client in another VLAN, the client will get
    random DNS results because the client has another network ID. This is because the default netmask used by netmask ordering is 255.255.255.0 (/24).
    If you change the netmask used by netmask ordering to 255.255.0.0 (/16) that will give you the nearest NLS on top.
    But not every customer uses a /16 subnet for each site. So, that's why it won't be usable for everybody.
    Ok, it is not an Enterprise solution and does not get the nobel prize, but what do you think?
    Boudewijn Plomp | BPMi Infrastructure & Security
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember, if you see a post that helped you please click "Vote as Helpful", and if it answered your question, please click "Mark as Answer".
    Ah, ok...sorry I assumed you knew that! Normally NMO needs to be 'tuned' to match the branch office subnets to get the expected/best results. That KB is pretty invaluable to setup it up properly. Like you say it does depend on customer having logical/consistent
    subnet boundaries definitions for it to work effectively though. I never said NMO was perfect :)
    Jason Jones | Security Consultant | Microsoft Consultant Services (MCS)

  • E2013 namespace, unbound and DNS round robin

    Hi,
    Just check Ross Smith's blog abuot
    namespace for E2013. He stated on "Figure 1" that VIPs per DAGs are behind single namespace "mail.contsoso.com" and clients reach those by DNS round robin. Anybody knows the answers for the questions:
    How clients find the other VIP1 if VIP2 is down, but client has got on the responce from the DNS with VIP2's IP?
    Do you need to have one IP per DAG? Would be it be possible to have one VIP only?
    Petri

    Hi,
    The re-connection is based on TTL value. You can look the following thread:
    https://social.technet.microsoft.com/Forums/exchange/en-US/8381c957-1189-4380-9e05-48f10ec15933/support-dns-roundrobin-for-exchange-2013-clients?forum=exchangesvravailabilityandisasterrecovery
    HLB can detect when a specific Client Access server has become unavailable and remove it from the set of servers that will handle inbound connections, but DNS round robin can't do this.
    Best regards,
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Belinda Ma
    TechNet Community Support

  • Sortlist - round robin - netmask ordering confusion

    I went through a crisis not long after splitting my Win2003 AD network into two VLANs, crisis documented at http://discussions.apple.com/thread.jspa?threadID=2361165
    In a nutshell, Windows DNS uses netmask ordering to resolve the "best" IP address to client queries based on their IP address. If a given host (on LAN) has more than one IP address on different VLAN/subnets, a query to a DNS server should give both IP answers, though only the one on the same subnet as the client is often accessible to that client. Thus, netmask ordering adds some intelligence to that process, overriding round-robin, and it works pretty well.
    Enter OS X Server using BIND, and set up a secondary zone to a Windows primary, and that all goes out the window. It seems OS X Server uses Round Robin by default. Though BIND is supposed to have similar functionality to Windows server's netmask ordering in a function called "sortlist," I can't figure out how to use that in OS X Server.
    Anyone ever mess with that?

    Camelot wrote:
    I'm not entirely sure I understand what you're asking. There is no concept in DNS of subnets - a host record maps to a network address (and vice versa), and subnets don't come into play.
    Unless what you're referring to is the ability of the name server to offer different replies based on the client's IP address…?
    If so, that is possible in BIND, via views, but there is no GUI support for multiple views in Server Admin (all zones exist in a single view served to all clients).
    If you want to offer different results to clients based on their address you'll need to implement a secondary view containing the zone data that should be visible to those clients. You'll also lose the ability to manage your DNS via the GUI. It's not that hard to do, but it does mean you'll typically be working in the shell to maintain your zone files.
    My nutshell approach was not clear, but you got the gist. But there is a concept of subnets implemented in Window server. I split our school network into two VLANs for security (keep students from even seeing admin servers) but needed to keep domain in Active Directory and our Windows servers. Thus, the domain controllers are multi-homed. School admin subnet is 172.16/16, student subnet is 172.20/16. Without netmask ordering or round robin enabled, Mac clients requesting internal DNS resolution would always get the 172.16.x.x address of the domain controllers, so they could not authenticate to the domain (the AD plugin apparently can only use the first IP returned in a query, it won't try others if unsuccessful). Netmask ordering enabled the DNS server to look at the IP of the DNS client and reply to queries with the IP which is in the client subnet first, then additional IPs, if any. The next bump I hit was that netmask ordering assumes a Class C subnet, not very well-documented, but a simple command fixed that, and it's worked excellent ever since-- until I tried designating a Mac server as a secondary and set some Mac clients to point to the Mac server for DNS resolution. They then get round-robin replies, so the ADplugin, which must make several DNS queries, gets confused. Research led me to sortlist, but whether it's that or "views" as you suggest, it's probably not something I want to jump into. I am going to give up on my Magic Triangle dreams and convert student and teachers to Open Directory over the summer, just create a new domain.
    P.S. technically, MS discourages having DCs multi-homed, but not having anything layer 3 to route between my new VLANs, it was my only option. In addition, the administrative file server I needed to keep away from student hacking is also the main Domain Controller (PDC emulator master), so adding routes to make the DC work across subnets would have defeated the security purpose. It's a smaller private school, limited resources. Thx.

  • ACE howto: ¿Classic round-robin if cookie not present?

    Hello team:
    My server farm behind the ACE will be used for applications that may or may not send cookies.
    So I have been asked to configure the ACE to be aware of a certain cookie in order to stick client to server as expected. In paralell, I have also been asked to execute a classic round robin algorithm if no cookie is present on the HTTP sessions.
    Then my question is: ¿ will my ACE, configured with the "sticky http-cookie ..." command, default to a classical round-robin algorithm if no cookie is detected in the HTTP request from the client?
    Your hints will be greatly appreciated.
    Best regards, Rogelio

    Rogelio,
    */ Create a http parameter-map, if you did not do so already:
    parameter-map type http HTTP
      case-insensitive
      persistence-rebalance
      set header-maxparse-length 65535
      set content-maxparse-length 65535
      length-exceed continue
    */ Match the cookie, and whatever value PHP created:
    class-map type http loadbalance match-any PHPSESSID
      2 match http cookie PHPSESSID cookie-value ".*"
    */ Create a policy map, add the PHPSESSID class-map, and assign the sticky serverfarm.
    */ Assign your real servers to the default class (class-default)
    policy-map type loadbalance http first-match STICKY_SLB_LOGIC
    class PHPSESSID
      sticky-serverfarm STICKY_SERVERS
    class class-default
      serverfarm REAL_SERVERS
    */ Add it to the service policy
    policy-map multi-match CLIENT_VIPS
      class VIP-30
        loadbalance vip inservice
        loadbalance policy STICKY_SLB_LOGIC
        loadbalance vip icmp-reply active
        appl-parameter http advanced-options HTTP
    Cheers mate,
    Søren Elleby Sørensen

  • 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.

  • Exchange 2013 and DNS Round Robin downside?

    Hi guys,
    I have a question regarding Exchange Server 2013 (SP1) and the use of DNS round robin.
    I have a customer that currently is running 2 CAS servers with NLB and we are currently investigating if it would be appropriate to move to a DNS RR solution so we can remove the CAS servers and install the CAS role on the Mailbox servers.
    (yes I know that CAS with NLB and Mbx with DAG cannot be used on the same server)
    What would be the downside of DNS RR?
    Request 1 will go to first MBX server, Reqeust 2 to second MBX server, Request 3 to third MBX server and then start over again. If MBX server 1 goes offline, it will still be used within the DNS RR solution and clients will be redirected towards that server.
    But how will clients react? Will Outlook 2010/2013 timeout since the server is not responding and do a autodiscover lookup again and then hopefully jump on the DNS that points towards another server?
    Is this true for pop/imap or a receive connector for SMTP relay aswell?

    Hi Fredrik,
    Hope this helps  out...
    Round robin doens't check the load on the network interfaces.It just passes on to the next one; for example Server1, Server2
    If server1 has a lot of traffic on his nic he still get more traffic onto his nic when round robin wants to.
    NLB gives some checkes on the load on the interfaces. Therefore it will make sure that that all servers has about the same amount of traffic.
    In Windows NLB we can able to create port rules for the virtual ip which is not applicable when you go DNS Round Robin
    DNS round robin the clients will see different IP addresses Wherea NLB uses single IP Address
    DNS round robin is not a good solution for redundancy. If one of the nodes goes down, you first have to go and remove its A record from the DNS server but then it may take some time before such a change is propergated. In the meantime you may have a number
    of clients attempt to access the dead IP.
    With load balancing you can remove a host from the set immediately (if it doesn't detect an unresponsive host automatically). The only affect of a downed server on the clients would be if some of the clients had session
    data on that server.
    Exchange Queries

  • How to Make a Line of Best Fit/Best Fit Line/Trendline in iWork Numbers '09

    I'm not sure if this is well-known or has been answered elsewhere already, but multiple Google searches have not shown this solution on how to create a line of best fit in Numbers '09 (there is another method that involves drawing a line yourself, but this is much easier and more accurate).
    I stumbled across this trying the above self-draw technique and got so excited I wanted to post the technique. So here is what you do:
    1) Type out your X and Y data
    2) Select the data and select Charts, then select the Scatter Plot
    3) Open up Inspector and select the Chart tab
    4) Select the "Series" tab below the picture of the Scatter Plot and the "Chart Colors..." button
    5) At the bottom of the Inspector window, open the "Advanced" arrow
    6) Select the "Trendline" tab and select the "Linear" trendline from the drop-down bar
    That's it! You can even select the options to show the line equation or the R-squared value!
    Here is a picture of the selected options and what your graph should look like (check that nice R-squared value!).
    http://i.imgur.com/AvfPv.png
    I hope this helps and hope it moves up to the top of the Google search page for this feature.

    Hi Asclepius37,
    Why not just search "trend" or "trendline" in the Numbers '09 User Guide?
    That would take you to page 149 of the guide and the article "Showing Trendlines in Charts," which lists a set of instructions very similar to those in your post.
    The Numbers '09 User Guide and the iWork Formulas and Functions User Guide are searchable pdf files, and may both be downloaded through kinks in the Help menu in Numbers. Both are excellent resources to have on hand.
    Regards,
    Barry
    PS: Searching "best fit" will return zero results, but "best" or "best-fit" will get you to the same article.
    B

  • 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

  • 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

Maybe you are looking for