2014년 12월 28일 일요일

Using RStudio, combination of vector operation and linear regression



Using RStudio, combination of vector operation and linear regression

Using RStudio, combination of vector operation and linear regression 

2014년 12월 26일 금요일

Using RStudio, linear regression model example(least square method)


Using RStudio, linear regression model example(least square method)

Using RStudio, linear regression model example(least square method)

Using RStudio, t test example



Using RStudio, t test example

Using RStudio, t test example

2014년 12월 15일 월요일

2014년 12월 14일 일요일

2014년 12월 11일 목요일

Using julia, calculating complex numbers operation


Using julia, calculating complex numbers operation


Using julia, calculating complex numbers operation

Using R, performing grid.circle lib

Using R, performing grid.circle lib

Using R, performing grid.circle lib

Using R, performing grid.circle lib

Using R, plotting user-defined function graphs



Using R, plotting user-defined function graphs


Using R, plotting user-defined function graphs

2014년 12월 8일 월요일

Using R, appending a data into a vector

Using R, appending a data into a vector


Using R, appending a data into a vector

Using R, a few functions operating on entire vectors

Using R, a few functions operating on entire vectors

Using R, a few functions operating on entire vectors

2014년 12월 7일 일요일

Using Ipython Notebook, Bayesian Inference

Using Ipython Notebook, Bayesian Inference


In [8]:
%matplotlib inline
from IPython.core.pylabtools import figsize
import numpy as np
from matplotlib import pyplot as plt
figsize(11, 9)
 
import scipy.stats as stats
 
dist = stats.beta
n_trials = [0, 10, 12, 3, 4, 5, 18, 15, 50, 500]
data = stats.bernoulli.rvs(0.5, size=n_trials[-1])
x = np.linspace(0, 1, 100)
 
# For the already prepared, I'm using Binomial's conj. prior.
for k, N in enumerate(n_trials):
    sx = plt.subplot(len(n_trials) / 2, 2, k + 1)
    plt.xlabel("$p$, probability of heads") \
        if k in [0, len(n_trials) - 1] else None
    plt.setp(sx.get_yticklabels(), visible=False)
    heads = data[:N].sum()
    y = dist.pdf(x, 1 + heads, 1 + N - heads)
    plt.plot(x, y, label="observe %d tosses,\n %d heads" % (N, heads))
    plt.fill_between(x, 0, y, color="#348ABD", alpha=0.4)
    plt.vlines(0.5, 0, 4, color="k", linestyles="--", lw=1)
 
    leg = plt.legend()
    leg.get_frame().set_alpha(0.4)
    plt.autoscale(tight=True)
 
 
plt.suptitle("Bayesian updating of posterior probabilities",
             y=1.02,
             fontsize=14)
 
plt.tight_layout()
In [ ]: