Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2281

Re: how to fit a dataset which consists of two parts with two different errors

Newsgroups comp.graphics.apps.gnuplot
Date 2014-01-30 22:46 -0800
References <9e2a6f3e-0d79-4484-8a60-529a57901c55@googlegroups.com> <lc8n57$gch$1@news.rz.uni-karlsruhe.de>
Message-ID <2a28d9ae-eff1-402c-a98e-d26655ed6f7f@googlegroups.com> (permalink)
Subject Re: how to fit a dataset which consists of two parts with two different errors
From "hugocoolens@gmail.com" <hugocoolens@gmail.com>

Show all headers | View raw


Op dinsdag 28 januari 2014 17:50:47 UTC+1 schreef Karl:
> Am 28.01.2014 14:20, schrieb hugocoolens@gmail.com:
> > 
> > I have to fit a dataset which consists of two parts: a part from 10e-6 to 1e-3
> > which has errorbars (0.01*0.033*$2+2e-9) and a second part from >1e-3 to 10e-3
> > which has errorbars (0.01*0.035*$2+600e-9)
> > 
> > Is it possible to give one fit command that uses the information here above
> > similar to the statement below but working for all the data?
> > 
> > 
> > fit f(x) 'mydata.dat' using ($1):($2):(0.01*0.035*$2+600e-9) via a,b
> > 
>
> You can use the ternary operator "a?b:c".
>
> error(x) = (x < 1e-3) ? (0.01*0.033*$2+2e-9) : (0.01*0.035*$2+600e-9)
>
> fit f(x) 'mydata.dat' using ($1):($2):(error($2)) via a,b
>
>
>  K
Thank you very much, this was exactly what I needed!
hugo

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to fit a dataset which consists of two parts with two different errors "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2014-01-28 05:20 -0800
  Re: how to fit a dataset which consists of two parts with two different errors Karl <mail.kfr@gmx.net> - 2014-01-28 17:50 +0100
    Re: how to fit a dataset which consists of two parts with two different errors "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2014-01-30 22:46 -0800
    Re: how to fit a dataset which consists of two parts with two different errors "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2014-01-31 08:29 -0800
      Re: how to fit a dataset which consists of two parts with two different errors Karl <mail.kfr@gmx.net> - 2014-01-31 18:10 +0100
        Re: how to fit a dataset which consists of two parts with two different errors "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2014-02-01 00:40 -0800

csiph-web