10

使用Calc进行线性拟合

 3 years ago
source link: https://www.lujun9972.win/blog/2020/02/06/%E4%BD%BF%E7%94%A8calc%E8%BF%9B%E8%A1%8C%E7%BA%BF%E6%80%A7%E6%8B%9F%E5%90%88/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用Calc进行线性拟合

今天又发现Calc的一个牛逼功能:进行线性拟合,其步骤如下:

  1. 以矩阵的形式输入待拟合的数据,其中每一行表示一个自变量的值,最后一行表示因变量的值。

    比如,对于公式 Y=aX_1 + bX_2 + bX_3 +d, 那么输入的矩阵就应该是这样的:

    [[ x1_1, x1_2, x1_3, x1_4 ...]
     [ x2_1, x2_2, x2_3, x2_4 ...]
     [ x3_1, x3_2, x3_3, x3_4 ...]
     [ y_1 , y_2 , y_3 , y_4 ...]]
    

    为了简单,我这里假设数据为

    [[ 1, 2, 3, 4,  5  ]
      [ 5, 7, 9, 11, 13 ]]
    
  2. (可选操作)我们可以调用gnuplot来根据这些数据画出散点图

    1. 按下 v u 将矩阵分解成多个数组,Calc显示如下

      2:  [1, 2, 3, 4, 5]
      1:  [5, 7, 9, 11, 13]
          .
      
    2. 按下 g f 进行快速做图,得到结果

      screenshot-27.png

      可以看出这些数据可以很好的你合成一个直线

    3. 按下 U 回退成原始数据
  3. 按下 a F (calc-curve-fit) 调用拟合命令,
  4. 选择拟合模型

    Calc的拟合命令支持多种拟合模型,因此会要求我们选择想要的拟合模型(按?可以查看支持的模型),我们这里选 1 表示线性拟合

  5. 选择自变量和参数的表示符号

    这里直接回车,选择默认的符号(x;a,b, 分号前的符号为自变量符号,分号后的符号为参数符号,符号之间用逗号分隔)。

  6. 得出结果 2. x + 3.

Calc_linear_fit.gif

我们还可以在Calc中调用gnuplot进行做图:

  1. 按下 g C (calc-graph-command)
  2. 输入 plot 2*x+3 回车得到图片

calc-linear-fit-gnuplot.png


Recommend

  • 85
    • totalcalc.com 7 years ago
    • Cache

    Total Calc - Calculate Anything

    Resources for students, teachers, and anyone else Explore dozens of free tools: calculators, unit converters, and more. For teachers, check out our worksheet generator tool....

  • 119

    使用scikit-learn进行线性回归分析, AI, Python,scikit-learn,LinearRegression, 接下来会有一系列文章讲解Python机器学习库:scikit-learn。本文是第一篇,我们会介绍一些基本概念以及讲解如何使用scikit-learn进行线性回归分析。

  • 27
    • www.tuicool.com 6 years ago
    • Cache

    Poppin Calc: Web Studio Edition

    What Even Are You? We’ve hit peak SC...

  • 52
    • www.gnu.org 5 years ago
    • Cache

    GNU Emacs Calc Manual

    The GNU Emacs Calculator Calc is an advanced desk calculator and mathematical tool written by Dave Gillespie that runs as part of the GNU Emacs environment. This manual, also written (mostly) by Dave Gillespie, is div...

  • 19
    • Github github.com 4 years ago
    • Cache

    guizero-calc

    main Go to file Code ...

  • 5
    • www.lujun9972.win 3 years ago
    • Cache

    使用Calc做微积分

    使用Calc做微积分 Calc居然还能计算微积分!不亏为穷人的matlab啊。 输入方程式,比如 1/x+x^2+1 根据minibuffer中的提示,输入微分变量,比如 x 得到结果 2x-x^-2

  • 7
    • www.lujun9972.win 3 years ago
    • Cache

    使用Calc求解代数方程式

    使用Calc求解代数方程式 今天发现calc的fsolve函数可以用来求解代数方程式: 在Calc中求解代数方程 比如,我下Calc(用M-x calc打开)下输入 'fsolve(2x+1=5,x) (其中最前面的 ' 表示使用Cal...

  • 11

    Using The CSS Function calc() Inside The LESS CSS Preprocessor By Ben Nadel on May 13, 2021 Tags:

  • 12

    fixed bug related to calc RPS by intervals for real-time stats https://t.co/YEkl3qOjNs #fsharp #csharp #loadtesting"Don’t miss what’s happeningPeople on Twitter are the first to know.

  • 15

    Practical Uses of CSS Math Functions: calc, clamp, min, max Posted on: Aug 15, 2021 Written by Stephanie Eckles This is episode #28 in a series examining mo...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK