Skip to content

Instantly share code, notes, and snippets.

%!TEX encoding = Shift-JIS
%Last update for this preamble : 2014-12-19
%pream01.tex -- jsarticle,,柱あり,listing 無
%
%usepackages
%
\usepackage{amsmath,amssymb}
\usepackage{bm}
\usepackage{ascmac}
%!TEX encoding = Shift-JIS
%Last update for this template : 2014-12-19
\documentclass[10pt,a4paper]{jsarticle} % Option : [twocolumn] / jsbook : [openany, oneside]
\usepackage[dvipdfmx,hiresbb]{graphicx} % graphicx
%
%====== preamble ===========================
%\input{C:/w32tex/share/texmf-dist/preamble/pream01.tex} % Win
%\input{/usr/local/share/texmf/preamble/pream01.tex} % Mac
%UTF-8 case : pream**_utf8.tex
%
# coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
def LeastRootSq(x, t, M):
aaa = np.array([x**k for k in range(2*M+1)])
aa = np.sum(aaa, axis=1)
A = np.array([[aa[i+j] for i in range(M+1)] for j in range(M+1)])
tt = np.array([x**k for k in range(M+1)])
# coding: utf-8
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def rms(p, df):
error = 0.
for index, list in df.iterrows():
error += 0.5*(np.polyval(p, list.x)-list.t)**2
return np.sqrt(2.*error/len(df))
# coding: utf-8
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def main():
M = 9
N = [15, 100]
sigma = 0.3
# coding: utf-8
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def y(w, x):
y = 0.
for i, ww in enumerate(w):
y += ww*(x**i)
return y
# coding: utf-8
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def y(w, x):
y = 0.
for i, ww in enumerate(w):
y += ww*(x**i)
return y
# coding: utf-8
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
alpha = 5.0e-03
beta = 11.1
def makems(m, dataset):
Phi = np.array([dataset.x.values**k for k in range(0, m+1)])
Option Explicit
Sub sample_ReadWordFromExcelVBA()
' ファイル名、拡張子検索用
Dim objFso As Object
Dim objF As Object
Dim dir As String
Dim ext As String
Dim filelist() As String
Dim picktag As String
Option Explicit
Const IntervalSld As Double = 2.5 'スライド切替時間[sec]
Const NumSelectSld As Long = 3 '日ごとに選択するスライド総数
Dim d0 As Date 'マクロ開始時の日付
Dim j0 As Long '日付d0での選択スライドの番号
'スライドショー実行(メイン)
Sub MainLoop()