Skip to content

Instantly share code, notes, and snippets.

mk-mode komasaru

Block or report user

Report or block komasaru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@komasaru
komasaru / regression_curve_pow.rb
Last active May 6, 2019
Ruby script to calculate a simple regression curve.(power)
View regression_curve_pow.rb
#! /usr/local/bin/ruby
#*********************************************
# Ruby script to calculate a simple regression curve.
# : y = a * x**b
# : 連立方程式を ガウスの消去法で解く方法
#*********************************************
#
class Array
def reg_curve_pow(y)
# 以下の場合は例外スロー
@komasaru
komasaru / regression_curve_frac.rb
Last active May 6, 2019
Ruby script to calculate a simple regression curve.(frac)
View regression_curve_frac.rb
#! /usr/local/bin/ruby
#*********************************************
# Ruby script to calculate a simple regression curve.
# : y = a + b / x
# : 連立方程式を ガウスの消去法で解く方法
#*********************************************
#
class Array
def reg_curve_frac(y)
# 以下の場合は例外スロー
@komasaru
komasaru / regression_curve_ln.rb
Last active May 6, 2019
Ruby script to calculate a simple regression curve.(ln)
View regression_curve_ln.rb
#! /usr/local/bin/ruby
#*********************************************
# Ruby script to calculate a simple regression curve.
# : y = a + b * ln(x)
# : 連立方程式を ガウスの消去法で解く方法
#*********************************************
#
class Array
def reg_curve_ln(y)
# 以下の場合は例外スロー
@komasaru
komasaru / regression_curve_sqrt.rb
Last active May 6, 2019
Ruby script to calculate a simple regression curve.(sqrt)
View regression_curve_sqrt.rb
#! /usr/local/bin/ruby
#*********************************************
# Ruby script to calculate a simple regression curve.
# : y = a + b * sqrt(x)
# : 連立方程式を ガウスの消去法で解く方法
#*********************************************
#
class Array
def reg_curve_route(y)
# 以下の場合は例外スロー
@komasaru
komasaru / regression_curve_4d.rb
Last active May 6, 2019
Ruby script to calculate a simple regression curve.(4d)
View regression_curve_4d.rb
#! /usr/local/bin/ruby
#*********************************************
# Ruby script to calculate a simple regression curve.
# : y = a + b * x + c * x^2 + d * x^3 + e * x^4
# : 連立方程式を ガウスの消去法で解く方法
#*********************************************
#
class Array
def reg_curve_4d(y)
# 以下の場合は例外スロー
@komasaru
komasaru / regression_curve_3d.rb
Last active May 6, 2019
Ruby script to calculate a simple regression curve.(3d)
View regression_curve_3d.rb
#! /usr/local/bin/ruby
#*********************************************
# Ruby script to calculate a simple regression curve.
# : y = a + b * x + c * x^2 + d * x^3
# : 連立方程式を ガウスの消去法で解く方法
#*********************************************
#
class Array
def reg_curve_3d(y)
# 以下の場合は例外スロー
@komasaru
komasaru / coefficient_of_determination_2d.f95
Last active Apr 8, 2019
Fortran source code to calculate a coefficent of determination for simple 2D regression.
View coefficient_of_determination_2d.f95
!****************************************************
! 単回帰分析(2次曲線回帰)の決定係数計算!
!
! date name version
! 2019.03.31 mk-mode.com 1.00 新規作成
!
! Copyright(C) 2019 mk-mode.com All Rights Reserved.
!****************************************************
!
module const
@komasaru
komasaru / coefficient_of_determination_line.f95
Last active Apr 8, 2019
Fotran source code to calculate a coefficent of determination for simple linear regression.
View coefficient_of_determination_line.f95
!****************************************************
! 単回帰分析(線形回帰)決定係数計算
!
! date name version
! 2019.03.31 mk-mode.com 1.00 新規作成
!
! Copyright(C) 2019 mk-mode.com All Rights Reserved.
!****************************************************
!
module const
@komasaru
komasaru / coefficient_of_determination_2d.rb
Created Mar 30, 2019
Ruby script to calculate a coefficent of determination for simple 2D regression.
View coefficient_of_determination_2d.rb
#! /usr/local/bin/ruby
#*********************************************************
# Ruby script to calculate a coefficient of determination.
#*********************************************************
#
class CoefficientOfDetermination
# 説明変数と目的変数
X = [83, 71, 64, 69, 69, 64, 68, 59, 81, 91, 57, 65, 58, 62]
Y = [183, 168, 171, 178, 176, 172, 165, 158, 183, 182, 163, 175, 164, 175]
@komasaru
komasaru / coefficient_of_determination_line.rb
Created Mar 30, 2019
Ruby script to calculate a coefficent of determination for simple linear regression.
View coefficient_of_determination_line.rb
#! /usr/local/bin/ruby
#*********************************************************
# Ruby script to calculate a coefficient of determination.
#*********************************************************
#
class CoefficientOfDetermination
# 説明変数と目的変数
X = [107, 336, 233, 82, 61, 378, 129, 313, 142, 428]
Y = [286, 851, 589, 389, 158, 1037, 463, 563, 372, 1020]
You can’t perform that action at this time.