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

Author: kaiming

Created: 2019-06-13 Thu 14:27

Emacs 24.5.1 (Org mode 8.2.10)

Validate

fit in gnuplot的更多相关文章

  1. k fit in Park Model

    software: Gnuplot input: area_averaged_axial_mean_velocity_TI_1.txt # One Rotor, front, eldad blade ...

  2. gnuplot: 一种更为简洁的曲线,柱状图绘图软件

    gnuplot: 一种更为简洁的曲线,柱状图绘图软件 gnuplot: 一种更为简洁的曲线,柱状图绘图软件 Zhong Xiewei Wed Jun 25 gnuplot简单介绍 关于gnuplot的 ...

  3. u-boot FIT image介绍_转自“蜗窝科技”

    转自:http://www.wowotech.net/u-boot/fit_image_overview.html 1. 前言 Linux kernel在ARM架构中引入设备树device tree( ...

  4. gnuplot使用,操作,保存等教程

    gnuplot绘制图像并保存 对于在Linux下工作的人,如果你经常要画一些二维图和简单的三维图的话,那么,gnuplot无疑是一个非常好的选择,不仅图形漂亮,而且操作简单.当然如果需要质量更高的三维 ...

  5. gnuplot安装的小问题

    今天在学习NS2的过程中接触到了awk和gnuplot来分析延迟,丢包等情况. gnuplot是一款非常精巧的绘图工具,使用方法也很简单,功能却很强大. 安装还是通过终端: sudo apt-get ...

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

  7. gnuplot 的安装

    需要同时安装gnuplot和gnuplot-x11才能画出图 sudo apt-get install gnuplot gnuplot-x11 gnuplot not showing the grap ...

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

  9. gnuplot配置HOME目录

    http://blog.csdn.net/jspenliany/article/details/39828261 本人使用gnuplot绘图,使用console version的来进行处理的时候,经常 ...

随机推荐

  1. 第一篇 .NET高级技术之索引器

    基础知识补充 索引 器 没有名字 ,索引器的内部本质 (ILSpy的IL模式下看)类型 this[参数]{get;set;} 可以是只读或者只写(在get或者set前加上private) 字符串是只读 ...

  2. iOS NavigationBar 导航栏自定义

    1. 设置导航栏NavigationBar的背景颜色: a)  setBarTintColor : 设置NagivationBar的颜色 也可以用 : [[UINavigationBar appear ...

  3. Centos6.8 配置 Tomcat

    1.安装Tomcat,安装之前必须先安装Java,先安装java 下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index. ...

  4. android 带checkbox的List

    可实现点击内容即可选中 http://blog.csdn.net/harvic880925/article/details/40475367

  5. python之迷宫BFS

    # @File: maze_queue_bfs from collections import deque maze = [ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0 ...

  6. Sublime Text3 配置C++(附oj刷题常用模板)

    # 下载对应平台的sublime sublime最新版下载, 字体样式个人喜欢Consolas, 另附注册码: -– BEGIN LICENSE -– TwitterInc 200 User Lice ...

  7. Social Net ZOJ - 3649

    Social Net ZOJ - 3649 题意: 反正原题题意我是看不懂... 参考:http://www.cnblogs.com/names-yc/p/4922867.html 给出一幅图,求最大 ...

  8. Java迭代器的用法【转】

    迭代器(Iterator) 迭代器是一种设计模式,它是一个对象,它可以遍历并选择序列中的对象,而开发人员不需要了解该序列的底层结构.迭代器通常被称为“轻量级”对象,因为创建它的代价小. Java中的I ...

  9. 单页Html及Android App供小孩学习常用汉字

    为了检验及帮助小孩学习常用汉字,简单开发本网页应用: 常用汉字是按使用频率排序的,来源于网上: 该简单应用 有Android APP下载 “学习常用汉字_20150910.apk” 单页Html 示例 ...

  10. AJPFX谈Java 性能优化之基本类型 vs 引用类型

    ★名词定义 先明确一下什么是“基本类型”,什么是“引用类型”. 简单地说,所谓基本类型就是 Java 语言中如下的8种内置类型: booleancharbyteshortintlongfloatdou ...