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. iOS [CIContext initWithOptions:]: unrecognized selector sent to instance 模拟器 iOS 8.4

    在模拟器(iPhone 4s,iOS 8.4)中运行应用时, 应用crash在了使用CIContext(options:nil) 这个API的一个纯Swift第三方库. StackOverFlow的解 ...

  2. 跟我一起玩Win32开发(12):使用控件——单选按钮

    今天,咱们还是接着玩“控件斗地主”,这是我原创的超级游戏,有益身心健康,玩一朝,十年少. 哦,对,脑细胞极速运动了一下,想起了一个问题,这个破问题虽然网上有很多种解决方案,但是,并没有让所有人都解决问 ...

  3. SpringBoot项目不占用端口启动

    @EnableScheduling @SpringBootApplication public class Application { public static void main(String[] ...

  4. hihocoder offer收割编程练习赛9 B 水陆距离

    思路: 宽搜,多个起点. 实现: #include <iostream> #include <cstdio> #include <algorithm> #inclu ...

  5. P3372 【模板】线段树 1 区间查询与区间修改

    题目描述 如题,已知一个数列,你需要进行下面两种操作: 1.将某区间每一个数加上x 2.求出某区间每一个数的和 输入输出格式 输入格式: 第一行包含两个整数N.M,分别表示该数列数字的个数和操作的总个 ...

  6. 关于php的问题

    $polling_items = db_fetch_assoc("SELECT * FROM poller_item WHERE rrd_next_step<=0 ORDER by h ...

  7. php用面向对象从mysql取数据

    <?php //建立数据库的链接@$_mysqli = new mysqli('localhost','root','123456','dbname');if(mysqli_connect_er ...

  8. 在同一页面显示多个JavaScript统计图表

    最近我接到一个开发任务,要求就"售后服务客户满意度调查问卷表"里客户填写的反馈答案做一个统计. 问题的例子如下: 您最后一次是何时购买了我们的产品? 服务人员服务态度是否友好.工作 ...

  9. Devops 技术图谱

  10. 世平信息(T 面试)

    1.跟我说下你们这个民主测评项目 在递归这一块扯了很久 2.遍历树结构,除了递归,还有什么方法? 3.如果数据库里面有2万条数据,你需要在前台用列表展示出来,有搜索功能.分页功能.总数:你觉得最需要优 ...