This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% PRML's synthetic data set | |
curve_fitting.x = [0.000000 0.111111 0.222222 0.333333 0.444444 0.555556 0.666667 0.777778 0.888889 1.000000]; | |
curve_fitting.t = [0.349486 0.830839 1.007332 0.971507 0.133066 0.166823 -0.848307 -0.445686 -0.563567 0.261502]; | |
function [product] = outer(a, b, fn) | |
R = length(a); | |
C = length(b); | |
product = zeros(R, C); | |
for r = 1:R | |
for c = 1:C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1; | |
clear | |
global theta = [0.33 25 1 0.03]; | |
beta = 50 | |
x = linspace(0, 1, 100); | |
data = load("curvefitting.txt"); | |
data = data(1:7, :); %% 一番右から3つを捨てる |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1; %% これがなくて関数定義から始まるとOctaveではファイル名と関数名が違うぞと怒られるので、スクリプトは1;から始める | |
function [score] = score68(theta) | |
global data_x; | |
global data_t; | |
global N; | |
global mu; | |
M = 6; | |
x = linspace(0, 1, M); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1; | |
clear | |
fig_id = 6; | |
thetas_6_5 = [ 1 4 0 0; | |
9 4 0 0; | |
1 64 0 0; | |
1 0.25 0 0; | |
1 4 10 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1; | |
clear | |
%global eta = [1 1]; %% 左図 | |
global eta = [1 0.01]; %% 右図 | |
global theta0 = 0.5; | |
N = 30; %% N=30は割と時間がかかる | |
xl = linspace(-1, 1, N); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- octave-3.6.3/Makefile 2012-11-17 22:31:59.000000000 +0900 | |
+++ octave-3.6.3-naoyat/Makefile 2012-11-17 21:54:30.000000000 +0900 | |
@@ -242,7 +242,8 @@ | |
ETAGS = etags | |
CTAGS = ctags | |
DIST_SUBDIRS = $(SUBDIRS) | |
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | |
+# DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | |
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(EXTRA_DIST) | |
distdir = $(PACKAGE)-$(VERSION) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property src_notebook : "markdown.src" | |
property dest_notebook : "markdown.html" | |
global madever | |
global CSS | |
set madever_dir to (path to scripts folder from user domain as text) & "madever" | |
set madever to load script file (madever_dir & ":madever.scpt") | |
set loadtheme to load script file (madever_dir & ":loadtheme.scpt") | |
set CSS to loadtheme's main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
## | |
## kobitonote - KobitoのアイテムをEvernoteにも保存する | |
## | |
## (c)2012 by @naoya_t | |
## | |
import os | |
import re | |
import sqlite3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1; | |
function g = gaussian(x, mu,sigma) | |
g = 1/sqrt(2*pi*sigma^2) * exp(-1/(2*sigma^2)*(x-mu)^2); | |
endfunction | |
function g = gaussian2(x, mu,Sigma) | |
g = 1/(2*pi*sqrt(det(Sigma))) * exp(-1/2*(x-mu)'*inv(Sigma)*(x-mu)); | |
endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1; | |
% | |
% コーシー分布 Cauthy distribution のpdf | |
% | |
function p = CauthyDistributionPDF(y) | |
p = arrayfun(@(x) 1.0/(pi*(1+x^2)), y); | |
endfunction | |
% | |
% コーシー分布に従う乱数 |