gnuplot - get errors on fit parameters, get fit output values as variables, print variable to screen
Asked Answered
A

1

5

Initial Question (Partially Answered)

I am using gnuplot's fitting routines to fit a function to some data, and extract a "characteristic decay time constant". (I call this parameter d in my fitting function.)

I have used the script code set fit quiet to prevent reams of text being printed to the terminal. However I now have no way of knowing what the final fit values were! (Except by inspecting the log file... which is arduous...)

Is there a way I can get the final fit parameter values back, store them in a variable, and print that variable?

I guess this is 2 questions in one... How do I print a variables value?

Answer to Initial Question

So after some playing around with gnuplot, I have found that the print command can print variables to screen, and that the parameters, eg d are already available for use as variables - ie; they are already variables.

So I can do the following: print "d=",d - the comma here is used to separate things you want to print. So I first print a string "d=" followed by the value of d.

Next Question

How do I obtain the errors on the variables I have used? Eg; if I fit a function with parameters a,b and c, how can I print the errors on these values?

Arriviste answered 16/6, 2015 at 13:13 Comment(4)
Quoting from the documentation: If activated by using "set fit errorvariables", the error for each fitted parameter will be stored in a variable named like the parameter, but with "_err" appended.Weep
@Weep Fantastic thanks - must have missed that when reading the docs earlier this week.Arriviste
@Weep Do you have a reference for this - it doesn't seem to be working?Arriviste
@Weep My bad - spelling error - it works fine, thanksArriviste
W
8

Quoting the documentation:

If activated by using set fit errorvariables, the error for each fitted parameter will be stored in a variable named like the parameter, but with "_err" appended.

Weep answered 16/6, 2015 at 13:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.