Menu

multi-branch fit in gnuplot

Help
Stefanie
2005-06-17
2013-02-10
  • Stefanie

    Stefanie - 2005-06-17

    Hello,

    can somebody explain the multi-branch fit option a bit more? I would like to fit three experimental data sets to three functions with two common variables.

    Is this possible?
    The example only shows how to do this for 2 data sets...

    Thanks,
    Stefanie

     
    • Hans-Bernhard Broeker

      It's hard to offer better explanations without knowing where and how the existing ones failed you.  It's really quite simple: multi-branch fits are 3D fits, e.g. they fit data to a model z=f(x,y).  The trick is that we have several different meanings of 'x', and we use 'y' to decide which of them to apply.

      Please have a look at both "help fit multi-branch" and at the fit.dem examples.

       
      • Stefanie

        Stefanie - 2005-06-19

        Hi Hans-Bernhard,

        thanks for replying to my message. I managed to fit my two functions with the two variables to TWO data sets - I would simply like to extend the
        (y==0) ? A(x):B(x) to three data sets and three functions with the two common variables.
        (y==0) ? A(x):B(x):C(x) obviously does not work, so it should be something along the line of
        (y==0) ? A(x):B(x) AND
        (y==1) ? B(x):C(x)... etc. really only needs a proper assignment of the 3D variable y to check for 0, 1 or 2.

        Any help is appreciated...

        Thanks,
        Stefanie 

         
    • Stefanie

      Stefanie - 2005-06-20

      Hello again,

      I managed to fit three data sets with three functions with two unknown variables by using

      f(x,y) = (y == 0) ? h1(x) : ((y==1) ? h2(x) : h3(x))
      fit f(x,y) 'syn_10_20_40.txt' using 1:-2:2:(1) via var1, var2

      Thanks for your help.

      Stefanie

       

Log in to post a comment.