fit in gnuplot
Table of Contents
1 fit-gnuplot
syntax
>> fit [xrange][yrange] function 'datafile' using modifier via paprameterfile
example:
input: house_price.dat
### 'house_price.dat'
## X-Axis: House price (in $1000) - Y-Axis: Square meters (m^2)
245 426.72
312 601.68
279 518.16
308 571.5
199 335.28
219 472.44
405 716.28
324 546.76
319 534.34
255 518.16
gnuplot> # m, q will be our fitting parameters
gnuplot> f(x) = m*x + q
gnuplot> fit f(x) 'house_price.dat' using 1:2 via m, q
iter chisq delta/lim lambda m q
0 5.8376960560e+05 0.00e+00 2.07e+02 1.000000e+00 1.000000e+00
1 1.6488461223e+04 -3.44e+06 2.07e+01 1.777346e+00 1.003262e+00
2 1.5195558950e+04 -8.51e+03 2.07e+00 1.815976e+00 1.068562e+00
3 1.4876544660e+04 -2.14e+03 2.07e-01 1.795915e+00 7.050054e+00
4 1.3188280257e+04 -1.28e+04 2.07e-02 1.594141e+00 6.715403e+01
5 1.3171060201e+04 -1.31e+02 2.07e-03 1.571627e+00 7.386063e+01
6 1.3171060179e+04 -1.63e-04 2.07e-04 1.571602e+00 7.386812e+01
iter chisq delta/lim lambda m q After 6 iterations the fit converged.
final sum of squares of residuals : 13171.1
rel. change during last iteration : -1.62785e-09 degrees of freedom (FIT_NDF) : 8
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 40.5756
variance of residuals (reduced chisquare) = WSSR/ndf : 1646.38 Final set of parameters Asymptotic Standard Error
======================= ==========================
m = 1.5716 +/- 0.2247 (14.3%)
q = 73.8681 +/- 65.65 (88.87%) correlation matrix of the fit parameters:
m q
m 1.000
q -0.981 1.000
To save m, and q values in a string and plotting
set terminal postscript eps font 24
set out 'house_price_fit.eps'
mq_value = sprintf("Parameters values\nm = %f k$/m^2\nq = %f k$", m, q)
# \n -->> next line
set title 'Linear Regression Example Scatterplot'
set ylabel 'House price (k$ = $1000)'
set xlabel 'Square meters (m^2)'
set style line 1 ps 1.5 pt 7 lc 'red'
set style line 2 lw 1.5 lc 'blue'
set grid
set key bottom center box height 1.4
set xrange [0:450]
set yrange [0:] set object 1 rect from 90,725 to 200, 650 fc rgb "white"
set label 1 at 100,700 mq_value
print 'house_price.dat' ls 1 title 'House price', f(x) ls 2 title 'Linear regression'
set out
figures/gnuplot/fit/house_price_fit.pdf

fit in gnuplot的更多相关文章
- k fit in Park Model
software: Gnuplot input: area_averaged_axial_mean_velocity_TI_1.txt # One Rotor, front, eldad blade ...
- gnuplot: 一种更为简洁的曲线,柱状图绘图软件
gnuplot: 一种更为简洁的曲线,柱状图绘图软件 gnuplot: 一种更为简洁的曲线,柱状图绘图软件 Zhong Xiewei Wed Jun 25 gnuplot简单介绍 关于gnuplot的 ...
- u-boot FIT image介绍_转自“蜗窝科技”
转自:http://www.wowotech.net/u-boot/fit_image_overview.html 1. 前言 Linux kernel在ARM架构中引入设备树device tree( ...
- gnuplot使用,操作,保存等教程
gnuplot绘制图像并保存 对于在Linux下工作的人,如果你经常要画一些二维图和简单的三维图的话,那么,gnuplot无疑是一个非常好的选择,不仅图形漂亮,而且操作简单.当然如果需要质量更高的三维 ...
- gnuplot安装的小问题
今天在学习NS2的过程中接触到了awk和gnuplot来分析延迟,丢包等情况. gnuplot是一款非常精巧的绘图工具,使用方法也很简单,功能却很强大. 安装还是通过终端: sudo apt-get ...
- Modified Least Square Method and Ransan Method to Fit Circle from Data
In OpenCv, it only provide the function fitEllipse to fit Ellipse, but doesn't provide function to f ...
- gnuplot 的安装
需要同时安装gnuplot和gnuplot-x11才能画出图 sudo apt-get install gnuplot gnuplot-x11 gnuplot not showing the grap ...
- gnuplot conditional plotting: plot col A:col B if col C == x
http://stackoverflow.com/questions/6564561/gnuplot-conditional-plotting-plot-col-acol-b-if-col-c-x H ...
- gnuplot配置HOME目录
http://blog.csdn.net/jspenliany/article/details/39828261 本人使用gnuplot绘图,使用console version的来进行处理的时候,经常 ...
随机推荐
- pyrcharm 编程规范
正常变量赋值, 等号左右各一个空格: 参数赋值, 等号左右都没有空格: 注释#后面一个空格 类定义和函数定义,前后各两行,而在类的里面定义成员函数,只需要空一行 文件最后一个空行 变量.函数.类最好都 ...
- Python Unicode and str
http://stackoverflow.com/questions/18034272/python-str-vs-unicode-types unicode is a character set. ...
- PHP fgets 函数
<?php $handle=fopen("../good/html/1.txt","r"); ; //打开一个远程文件 $content="&q ...
- Ionic之ui-sref引入图片,图片部分挡住解决方案
ionic图片设置大小跟图片像素相同,但是使用ui-sref="parkInfo"上半部分图片会挡住,增加height的高度,就可以显示原本图片 页面: <ion-conte ...
- Cocos工作两周感受
我是一个专注搞Unity开发的程序猿哈哈,但是最近的项目要采用Cocos引擎开发.在迷茫和学习成长中已经不知不觉过了两周.我就简单谈谈我这两周学习Cocos的一个感受. 具体说公司是采用js语言来开发 ...
- 4. iOS测试常用方法
1. [XCUIElement exists]方法只能确定这个View是否存在,即使不在当前屏幕上也返回True.如果要确定View是否在屏幕可见范围内,可以判断其Frame是否在Window的 ...
- qt read excel
void exceladapter::readfile(QString filename, QString sheetname, int colNo){ QSqlDatabase db = QSqlD ...
- k-window的关闭与打开设置
// 打开弹框窗口 public showKwinDow() { const that = this as any; // 设置窗口居中 that.$refs['setAddEdit'].widget ...
- Excel数据导入SQL Server
基本有2种方案,都是无需安装Office的方案 Ole DB读取 + BulkCopy 获取Excel各个SheetName //连接串 string strConn = "Provider ...
- IOS之UIStepper控件详解
在iOS5中新增了一个数字输入控件UIStepper,它可以递进式输入数量.UIStepper继承自UIControl,它主要的事件是UIControlEventValueChanged,每当它的值改 ...