Skip to content

Instantly share code, notes, and snippets.

mk-mode komasaru

View GitHub Profile
@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]
@komasaru
komasaru / regression_curve_2.f95
Last active Apr 8, 2019
Fortran 95 source code to compute a simple regression curve(2d)(ver.2).
View regression_curve_2.f95
!****************************************************
! 単回帰曲線(2次回帰)計算
! : y = a + b * x + c * x^2
! : 連立方程式を ガウスの消去法で解く方法
! date name version
! 2019.03.17 mk-mode.com 1.00 新規作成
!
! Copyright(C) 2019 mk-mode.com All Rights Reserved.
!****************************************************
@komasaru
komasaru / regression_curve.f95
Last active Apr 8, 2019
Fortran 95 source code to compute a simple regression curve(2d).
View regression_curve.f95
!****************************************************
! 単回帰曲線(2次回帰)計算
! : y = a + b * x + c * x^2
! date name version
! 2019.03.17 mk-mode.com 1.00 新規作成
!
! Copyright(C) 2019 mk-mode.com All Rights Reserved.
!****************************************************
!
@komasaru
komasaru / regression_line_2.f95
Last active Apr 8, 2019
Fortran 95 source code to calculate a simple linear regression line.(Ver.2)
View regression_line_2.f95
!****************************************************
! 単回帰直線計算
! : y = a + b * x
! : 連立方程式を ガウスの消去法で解く方法
! date name version
! 2018.12.18 mk-mode.com 1.00 新規作成
!
! Copyright(C) 2018 mk-mode.com All Rights Reserved.
!****************************************************
@komasaru
komasaru / regression_curve_2.rb
Created Mar 15, 2019
Ruby script to calculate a simple linear regression curve.(Ver.2)
View regression_curve_2.rb
#! /usr/local/bin/ruby
#*********************************************
# Ruby script to calculate a simple linear regression curve.
# : y = a + b * x + c * x^2
# : 連立方程式を ガウスの消去法で解く方法
#*********************************************
#
class Array
def reg_curve(y)
# 以下の場合は例外スロー
@komasaru
komasaru / regression_line_2.rb
Created Mar 15, 2019
Ruby script to calculate a simple linear regression line.(Ver.2)
View regression_line_2.rb
#! /usr/local/bin/ruby
#*********************************************
# Ruby script to calculate a simple lenear regression line.
# : y = a + b * x
# : 連立方程式を ガウスの消去法で解く方法
#*********************************************
#
class Array
def reg_line(y)
# 以下の場合は例外スロー
@komasaru
komasaru / sle_lu.f95
Last active Apr 10, 2019
Fortran 95 source code to solve simultaneous equations by LU-decomposition(outer-product form).
View sle_lu.f95
!************************************************************
! 連立1次方程式の解法 ( LU 分解(外積形式ガウス法) )
!
! date name version
! 2019.03.13 mk-mode.com 1.00 新規作成
!
! Copyright(C) 2019 mk-mode.com All Rights Reserved.
!************************************************************
!
module const
You can’t perform that action at this time.