September 2010アーカイブ

調査は続行、パート1

| コメント(0) | トラックバック(0)

 テイラーの微分補正法のアルゴリズムを今更ながら
理解し始める。このあたりのことは語学習得に目処が
立ってからやろうと決めていたが、つい手が伸びて
しまった。

 次のトピックに加える関数形をこれから決める
予定だが、まあじっくり進める方針に変更はなく、
これまで同様のペースになろうか。

 ここからが今日の課題。

 英検対策は読解とリス。正答率は、読解が5/6で、
リスが9/10。読み込むポイントがずれており、語彙
の強化で乗り切る算段。

 独検対策は語彙と聞き取り。die Donau, ダニューブ
河、das Mailand, ミラノ市、das Moscow, モスコー市、
das Neapel, ナポリ、der Nil, ナイル河、das Prag,
プラーグ市、das Venedig, ヴェニス、das Warschau,
ワルソー市、ほぼ英語の読み方で表記がなされていた
点と綴りの意外性の観点から辞書を引き直す経過となる。

 明日もがんばろう。

 では。

This article is principally indebted to the works of Yoshiyuki Wakui, who is Japanese researcher in mathematics, in the same way as Part 1. I experimentally introduced the bimodal distribution to the research and I'd very much appreciate the useful descriptions.

First I also tentatively outline the situation we were put in. Someone who was busy with his work generated two sorts of normal random numbers with a computer. One followed N(-0.7,1) and the other followed N(0.7,1). As his phone abruptly rang, he had to deal with something urgent. After a while he realized he clean forgot the variances of the normal random variables and barely remembered the population means of the data sets and the distributions of the data sets. Unfortunately, he needed to generate the additional normal random numbers which followed the almost same normal distributions.

1. The Data Sets
The data sets he generated at that time is given below.

    n     1  2  3  4  5 
  yA   -2.18  -1.19  -0.74  -1.2  -2.53 
    n     6  7  8  9  10 
  yA   -0.5  0.09  0.31  -1.71  -0.67 
    n     11  12  13  14  15 
  yB   0.59  0.13  1.22  0.45  -0.22 
    n     16  17  18  19  20 
  yB   0.15  1.5  1.06  1.32  1.88 

The unstratified sample mean is about -0.11 and the unstratified and unbiased sample variance is about 1.52. Number 1-10, yA are actually generated from the normal distribution N(-0.7,1) and number 11-20, yB are generated from the normal distribution N(0.7,1). He clean forgot the population variances of the data sets but fortunately remembered the population means of the data sets, yA and yB. That is to say we pretend to forget the population variances of the data sets, yA and yB.

2. The Estimation of The Prior Distribution
I supposed that the population mean μ of the random variables y followed the bimodal distribution, that the population mean μA of the random variables yA and the population mean μB of the random variables yB followed the different normal distributions, that the hyperparameter, which was the probability that the population mean of the 10 random variables yA of the 20 random variables y took the population mean μA, was set to 0.5, that the hyperparameter, which was the probability that the population mean of the 10 random variables yB of the 20 random variables y took the population mean μB, was set to 0.5, that the population mean μA was -0.7, that the population mean μB was 0.7, that the population variance of μA and μB was in proportion to the population variance σ2 of the random variables y, and that the population variance σ2 of the random variables y followed the inverse gamma distribution. The example of the prior distribution is given below.
$$p\left(\theta\right)=\sum_{j=A}^Bp_j\left(\mu\right) p\left(\sigma^2\right)$$

We substitute pA(μ), B(μ), and p(σ2) in the above equation to find the prior distribution.
$$p_A\left( \mu \right) = \frac{1}{\sqrt{2\pi\frac{\sigma^2}{r}}} \exp{ \left\{-\frac{\left(\mu+0.7\right)^2}{\frac{2\sigma^2}{r}}\right\} } \times \frac{1}{2}$$
$$p_B\left( \mu \right) = \frac{1}{\sqrt{2\pi\frac{\sigma^2}{r}}} \exp{ \left\{-\frac{\left(\mu-0.7\right)^2}{\frac{2\sigma^2}{r}}\right\} } \times \frac{1}{2}$$
$$p\left( \sigma^2 \right) = \frac{\beta^\alpha}{\Gamma\left(\alpha\right)} \left( \frac{1}{\sigma^2} \right)^{\alpha+1}  \exp{ \left( -\frac{\beta}{\sigma^2} \right)} $$

We also substitute the parameters for both E(σ2)
and Var(σ2) in the below equations to find the
value of both α and β.
$$E\left( \sigma^2 \right) = \frac{\beta}{\alpha-1}  \hspace{10mm}\alpha > 1 $$
$$Var\left( \sigma^2 \right) = \frac{\beta^2}{\left( \alpha+1 \right)^2 \left( \alpha-2 \right)} \hspace{10mm}\alpha > 2 $$

      source code: PriorMultiModal.java

import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class PriorMultiModal extends Applet implements ActionListener{

// variable set
private static final long serialVersionUID = -3846703423854379608L;
final static int StartingX=50,StartingY=527;
final static String[] rulerX = {"",""," -1.6",""," -0.8", ""," 0",""," 0.8",""," 1.6",""};
final static String[] rulerY = {"",""," 0.2",""," 0.6", ""," 1.0",""," 1.4",""," 1.8",""};
final static String[] rulerZ = {"","","","",""," 0","","","","","","","",""};
final int EndingX=StartingX+transformation(120,120,120).x;
final int EndingY=StartingY+transformation(120,-120,-120).y;
public int[] SmallestInnerPart=new int[EndingX+1];
public int[] LargestInnerPart=new int[EndingX+1];
public static double exp = 1.0;
public static double var = 1.0;
public static double ratio = 3.0;
JTextField yx = new JTextField("1.0");
JTextField yn = new JTextField("1.0");
JTextField yr = new JTextField("3.0");
JLabel label1 = new JLabel("The Prior Distribution",JLabel.CENTER);
JLabel label2 = new JLabel("<html><body><font size=3>The Expectation of σ<sup>2</sup> (0<E(σ<sup>2</sup>)≤2.0)</font></body></html>", JLabel.CENTER);
JLabel label3 = new JLabel("<html><body><font size=3>The Variance of σ<sup>2</sup> (0<Var(σ<sup>2</sup>)≤10<sup>8</sup>)</font></body></html>", JLabel.CENTER);
JLabel label4 = new JLabel("<html><body><font size=3>The Ratio of σ<sup>2</sup> to Var(μ<sub>j</sub>) (0<r≤10<sup>8</sup>)</font></body></html>", JLabel.CENTER);

public void init(){
label1.setPreferredSize(new Dimension(400,24));
label1.setFont(new Font("Serif",Font.BOLD,15));
add(label1);
label2.setPreferredSize(new Dimension(260,23));
label2.setFont(new Font("Serif",Font.BOLD,11));
add(label2);
yx.setPreferredSize(new Dimension(120,23));
add(yx);
label3.setPreferredSize(new Dimension(260,23));
label3.setFont(new Font("Serif",Font.BOLD,11));
add(label3);
yn.setPreferredSize(new Dimension(120,23));
add(yn);
label4.setPreferredSize(new Dimension(260,23));
label4.setFont(new Font("Serif",Font.BOLD,11));
add(label4);
yr.setPreferredSize(new Dimension(120,23));
add(yr);
yx.addActionListener(this);
yn.addActionListener(this);
yr.addActionListener(this);
}

public void actionPerformed(ActionEvent e){
if(e.getSource()==yx){exp = Double.valueOf(yx.getText()).doubleValue();
if(exp <= 0 || exp > 2.0){exp=1.0;
}
}
if(e.getSource()==yn){var = Double.valueOf(yn.getText()).doubleValue();
if(var <= 0 || var > Math.pow(10.0,8))
{var=1.0;
}
}
if(e.getSource()==yr){ratio = Double.valueOf(yr.getText()).doubleValue();
if(ratio <= 0 || ratio > Math.pow(10.0,8))
{ratio=3.0;
}
}
yx.setText(""+exp);
yn.setText(""+var);
yr.setText(""+ratio);
repaint();
}

public void paint(Graphics g){

Point dot,dot1,dot2,dot3,dot4,dot5,dot6;
Graphics2D g2 = (Graphics2D)g;
GradientPaint gp1 = new GradientPaint(0, 0, new Color(154,181,228), 0,470,new Color(225,232,245), true);
g2.setPaint(gp1);
g2.fillRect(0,0,460,447);
super.paint(g);

// x axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(120,-120,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
for(int i=0;i<21;i++){
dot1=transformation((120/10*i-120),-120,0);
if(i % 4==0){
dot2=transformation((120/10*i-120),(-120-10),0);
g.setColor(new Color(128,128,128));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g2.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerX[i/2],dot2.x-48,dot2.y+15);
if(i==8)
g.drawString("μ",dot2.x+28,dot2.y+30);
}
}

// y axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(-120,120,0);
dot3=transformation(-120,120,0);
dot4=transformation(-120,120,210);
dot5=transformation(120,-120,0);
dot6=transformation(120,120,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
g.drawLine(dot5.x,dot5.y,dot6.x,dot6.y);
for(int i=0;i<210;i=i+1){
dot3=transformation(-119,120,i);
dot4=transformation(120,120,i);
g.setColor(new Color(154,181,228));
            g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
}
g.setColor(new Color(128,128,128));
for(int i=3;i<10;i++){
dot3=transformation(-120,120,(12/4*(i+3)-15)*10);
dot4=transformation(120,120,(12/4*(i+3)-15)*10);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
}
for(int i=0;i<21;i++){
dot1=transformation(120,(12*i-120),0);
if(i % 4==0){
dot2=transformation((12+1)*10,(12*i-120),0);
g.setColor(new Color(128,128,128));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerY[i/2],dot2.x-10,dot2.y+13);
if(i==8) g.drawString("σ",dot2.x+38,dot2.y+16);
g2.setFont(new Font ("SanSerif",Font.PLAIN,8));
if(i==8) g.drawString("2",dot2.x+47,dot2.y+9);
}
}

// z axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(-120,-120,210);
dot3=transformation(-120,119,210);
dot4=transformation(-120,119,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot2.x,dot2.y,dot3.x,dot3.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
for(int i=0;i<240;i=i+1){
g.setColor(new Color(154,181,228));
dot5=transformation(-120,(-119+i),210);
dot6=transformation(-120,(-119+i),0);
g.drawLine(dot5.x,dot5.y,dot6.x,dot6.y);
}
g.setColor(new Color(128,128,128));
for(int i=2;i<10;i++){
dot1=transformation(-120,-120,(30*(i+3)-150));
dot2=transformation(-130,-120,(30*(i+3)-150));
dot3=transformation(-120,-119,(30*(i+3)-150));
dot4=transformation(-120,120,(30*(i+3)-150));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
g2.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerZ[(i+3)],dot2.x-38,dot2.y+5);
if(i==5) g.drawString("L",dot2.x-25,dot2.y-110);
}

// Coloring
for(int i=0;i<=EndingX;i++){
SmallestInnerPart[i]=EndingY;
LargestInnerPart[i]=0;
}
dot=new Point();
for(double x=120;x>=-120;x-=0.2)
for(double y=-120;y<=120;y+=0.2){
double transX=x/60;
double transY=y/120+1;
double transZ=function(transX,transY);
double z=transZ*15.2;
dot=transformation(x,y,z);
if(dot.y<SmallestInnerPart[dot.x]){
SmallestInnerPart[dot.x]=dot.y;
g.setColor(gradation(z));
g.drawRect(dot.x,dot.y,1,1);
}
if(dot.y>LargestInnerPart[dot.x]){
LargestInnerPart[dot.x]=dot.y;
g.setColor(new Color(128,128,128));
g.drawRect(dot.x,dot.y,1,1);
}
}
}

public static double function(double x, double y){
double z;
double k0;
double k1;
double u;
u=Math.pow((2*Math.PI)*(y/ratio),(-0.5))*(Math.exp(-Math.pow((x-0.7),2)/(2*y/ratio))+Math.exp
(-Math.pow((x+0.7),2)/(2*y/ratio)))/2;
 k0=Math.pow(exp,2)/var+2;
k1=Math.pow(exp,3)/var+exp;
z=Math.pow(y,(-k0-1))*Math.exp((-k1)/(y))*u;
if(y>=0){
if(z>=0){
if(u>=0)
return 80*z;
else return 0;
}
else return 0;
}
else return 0;
}

public Color gradation(double z){
int d,r,g,b;
z=z*5.2;
if(z>=0) d=(int)z % 256;
else d=255-(-(int)z % 256);
int c=(int)(d/85.334);
switch(c){
case 0: r=79+76*d/86;
g=129+58*d/86;
        b=189-100*d/86;
break;
case 1: r=155+37*(d-86)/85;
g=187-99*(d-86)/85;
b=89-12*(d-86)/85;
break;
case 2: r=192-113*(d-171)/84;
g=88+41*(d-171)/84;
b=77+112*(d-171)/84;
break;
default: r=0; g=0; b=0;
break;
}
Color color=new Color(r,g,b);
return color;
}

public Point transformation(double x,double y,double z){
Point dot=new Point();
dot.x=StartingX+(int)((x+120)+Math.cos(Math.toRadians(30))*(y+120)/2);
dot.y=StartingY-(int)(Math.sin(Math.toRadians(30))*(y+120)/2+(z+120));
return dot;
}
}

3. The Estimation of The Posterior Distribution
The example of the conditional likelihood function is given below.
$$L\left( y_A|\theta \right) = \prod_{i=1}^{10}{\left[ \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\left( -\frac{\left( y_i-\mu\right)^2}{2\sigma^2} \right)}\times \frac{1}{2}\right] }$$
$$L\left( y_B|\theta \right) = \prod_{i=11}^{20}{\left[ \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\left( -\frac{\left( y_i-\mu\right)^2}{2\sigma^2} \right)}\times \frac{1}{2}\right] }$$

The posterior distribution is in proportion to the product of the conditional likelihood function multiplied by the prior distribution and the example with weight wj is given below.
$$p\left( \theta|y \right) \varpropto \sum_{j=A}^BL\left(y_j|\theta\right)p_j\left(\mu\right) p\left(\sigma^2\right)$$
$$\sum_{j=A}^Bw_jL\left(y_j|\theta\right)p_j\left(\mu\right) p\left(\sigma^2\right)$$

      source code: PosteriorMultiModal.java

import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class PosteriorMultiModal extends Applet implements
ActionListener{

// variable set
private static final long serialVersionUID = -3578181170658236841L;
final static int StartingX=50,StartingY=527;
final static String[] rulerX = {"",""," -1.6",""," -0.8",""," 0",""," 0.8",""," 1.6",""};
final static String[] rulerY = {"",""," 0.2",""," 0.6",""," 1.0",""," 1.4",""," 1.8",""};
final static String[] rulerZ = {"","","","",""," 0","","","","","","","",""};
final int EndingX=StartingX+transformation(120,120,120).x;
final int EndingY=StartingY+transformation(120,-120,-120).y;
public int[] SmallestInnerPart=new int[EndingX+1];
public int[] LargestInnerPart=new int[EndingX+1];
public static double exp = 1.0;
public static double var = 1.0;
public static double ratio = 10.0;
JTextField yx = new JTextField("1.0");
JTextField yn = new JTextField("1.0");
JTextField yr = new JTextField("10.0");
JLabel label1 = new JLabel("The Posterior Distribution",JLabel.CENTER);
JLabel label2 = new JLabel("<html><body><font size=3>The Expectation of σ<sup>2</sup> (0<E(σ<sup>2</sup>)≤2.0)/font></body></html>", JLabel.CENTER);
JLabel label3 = new JLabel("<html><body><font size=3>The Variance of σ<sup>2</sup> (0<Var(σ<sup>2</sup>)≤10<sup>8</sup>)</font></body></html>", JLabel.CENTER);
JLabel label4 = new JLabel("<html><body><font size=3>The Ratio of σ<sup>2</sup> to Var(μ<sub>j</sub>) (0<r≤
10<sup>8</sup>)</font></body></html>", JLabel.CENTER);

public void init(){

label1.setPreferredSize(new Dimension(400,24));
label1.setFont(new Font("Serif",Font.BOLD,15));
add(label1);
label2.setPreferredSize(new Dimension(260,23));
label2.setFont(new Font("Serif",Font.BOLD,11));
add(label2);
yx.setPreferredSize(new Dimension(120,23));
add(yx);
label3.setPreferredSize(new Dimension(260,23));
label3.setFont(new Font("Serif",Font.BOLD,11));
add(label3);
yn.setPreferredSize(new Dimension(120,23));
add(yn);
label4.setPreferredSize(new Dimension(260,23));
label4.setFont(new Font("Serif",Font.BOLD,11));
add(label4);
yr.setPreferredSize(new Dimension(120,23));
add(yr);
yx.addActionListener(this);
yn.addActionListener(this);
yr.addActionListener(this);
}

public void actionPerformed(ActionEvent e){
if(e.getSource()==yx){exp = Double.valueOf(yx.getText()).doubleValue();
if(exp <= 0 || exp > 2.0){exp=1.0;
}
}
if(e.getSource()==yn){var = Double.valueOf(yn.getText()).doubleValue();
if(var <= 0 || var > Math.pow(10.0,8)){var=1.0;
}
}
if(e.getSource()==yr){ratio = Double.valueOf(yr.getText()).doubleValue();
if(ratio <= 0 || ratio > Math.pow(10.0,8))
{ratio=10.0;
}
}
yx.setText(""+exp);
yn.setText(""+var);
yr.setText(""+ratio);
repaint();
}

public void paint(Graphics g){

Point dot,dot1,dot2,dot3,dot4,dot5,dot6;
Graphics2D g2 = (Graphics2D)g;
GradientPaint gp1 = new GradientPaint(0, 0, new Color(154,181,228), 0,470,new Color(225,232,245), true);
g2.setPaint(gp1);
g2.fillRect(0,0,460,447);
super.paint(g);

// x axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(120,-120,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
for(int i=0;i<21;i++){
dot1=transformation((120/10*i-120),-120,0);
if(i % 4==0){
dot2=transformation((120/10*i-120),(-120-10),0);
g.setColor(new Color(128,128,128));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g2.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerX[i/2],dot2.x-48,dot2.y+15);
if(i==8)
g.drawString("μ",dot2.x+28,dot2.y+30);
}
}

// y axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(-120,120,0);
dot3=transformation(-120,120,0);
dot4=transformation(-120,120,210);
dot5=transformation(120,-120,0);
dot6=transformation(120,120,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
g.drawLine(dot5.x,dot5.y,dot6.x,dot6.y);
for(int i=0;i<210;i=i+1){
dot3=transformation(-119,120,i);
dot4=transformation(120,120,i);
g.setColor(new Color(154,181,228));
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
}
g.setColor(new Color(128,128,128));
for(int i=3;i<10;i++){
dot3=transformation(-120,120,(12/4*(i+3)-15)*10);
dot4=transformation(120,120,(12/4*(i+3)-15)*10);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
}
for(int i=0;i<21;i++){
dot1=transformation(120,(12*i-120),0);
if(i % 4==0){
dot2=transformation((12+1)*10,(12*i-120),0);
g.setColor(new Color(128,128,128));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerY[i/2],dot2.x-10,dot2.y+13);
if(i==8) g.drawString("σ",dot2.x+38,dot2.y+16);
g2.setFont(new Font ("SanSerif",Font.PLAIN,8));
if(i==8) g.drawString("2",dot2.x+47,dot2.y+9);
}
}

// z axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(-120,-120,210);
dot3=transformation(-120,119,210);
dot4=transformation(-120,119,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot2.x,dot2.y,dot3.x,dot3.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
for(int i=0;i<240;i=i+1){
g.setColor(new Color(154,181,228));
dot5=transformation(-120,(-119+i),210);
dot6=transformation(-120,(-119+i),0);
g.drawLine(dot5.x,dot5.y,dot6.x,dot6.y);
}
g.setColor(new Color(128,128,128));
for(int i=2;i<10;i++){
dot1=transformation(-120,-120,(30*(i+3)-150));
dot2=transformation(-130,-120,(30*(i+3)-150));
dot3=transformation(-120,-119,(30*(i+3)-150));
dot4=transformation(-120,120,(30*(i+3)-150));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
g2.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerZ[(i+3)],dot2.x-38,dot2.y+5);
if(i==5) g.drawString("L",dot2.x-25,dot2.y-110);
}

// Coloring
for(int i=0;i<=EndingX;i++){
SmallestInnerPart[i]=EndingY;
LargestInnerPart[i]=0;
}
dot=new Point();
for(double x=120;x>=-120;x-=0.2)
for(double y=-120;y<=120;y+=0.2){
double transX=x/60;
double transY=y/120+1;
double transZ=function(transX,transY);
double z=transZ*3.8;
dot=transformation(x,y,z);
if(dot.y<SmallestInnerPart[dot.x]){
SmallestInnerPart[dot.x]=dot.y;
g.setColor(gradation(z));
g.drawRect(dot.x,dot.y,1,1);
}
if(dot.y>LargestInnerPart[dot.x]){
LargestInnerPart[dot.x]=dot.y;
g.setColor(new Color(128,128,128));
g.drawRect(dot.x,dot.y,1,1);
}
}
}

public static double function(double x, double y){
double z1;
double z2;
double k0;
double k1;
double u1;
double u2;
double d01=1;
double d02=1;
double[] d1= new double[21];
double[] d2={-2.18,-1.19,-0.74,-1.2,-2.53,-0.5,0.09,0.31,-1.71,-0.67};
double[] d3= new double[21];
double[] d4= {0.59,0.13,1.22,0.45,-0.22,0.15,1.5,1.06,1.32,1.88};
for(int i=0;i<10;i++){
d1[i]=Math.pow(2*Math.PI*y,(-0.5))*Math.exp(-Math.pow((d2[i]-x),2)/(2*y));
d01=2.4*d01*d1[i];
}
for(int i=0;i<10;i++){
d3[i]=Math.pow(2*Math.PI*y,(-0.5))*Math.exp(-Math.pow((d4[i]-x),2)/(2*y));
d02=2.4*d02*d3[i];
}
u1=Math.pow((2*Math.PI)*(y/ratio),(-0.5))*Math.exp(-Math.pow((x+0.7),2)/(2*y/ratio));
u2=Math.pow((2*Math.PI)*(y/ratio),(-0.5))*Math.exp(-Math.pow((x-0.7),2)/(2*y/ratio));
 k0=Math.pow(exp,2)/var+2;
k1=Math.pow(exp,3)/var+exp;
z1=9*Math.pow(y,(-k0-1))*Math.exp((-k1)/(y))*u1;
z2=9*Math.pow(y,(-k0-1))*Math.exp((-k1)/(y))*u2;
if(y>=0){
if(z1>=0 && z2>=0){
if(u1>=0 && u2>=0)
return 1200*d01*z1+36*d02*z2;
else return 0;
}
else return 0;
}
else return 0;
}

public Color gradation(double z){
int d,r,g,b;
z=z*5.2;
if(z>=0) d=(int)z % 256;
else d=255-(-(int)z % 256);
int c=(int)(d/85.334);
switch(c){
case 0: r=79+76*d/86;
g=129+58*d/86;
        b=189-100*d/86;
break;
case 1: r=155+37*(d-86)/85;
g=187-99*(d-86)/85;
b=89-12*(d-86)/85;
break;
case 2: r=192-113*(d-171)/84;
g=88+41*(d-171)/84;
b=77+112*(d-171)/84;
break;
default: r=0; g=0; b=0;
break;
}
Color color=new Color(r,g,b);
return color;
}

public Point transformation(double x,double y,double z){
Point dot=new Point();
dot.x=StartingX+(int)((x+120)+Math.cos(Math.toRadians(30))*(y+120)/2);
dot.y=StartingY-(int)(Math.sin(Math.toRadians(30))*(y+120)/2+(z+120));
return dot;
}
}

4. The Metropolis Sampler algorithm
The example of the Metropolis sampler is given below.
$$\alpha=\frac{\displaystyle\sum_{j=A}^{B}L\left(y_j|\mu_{i}+e_{i1}, \sigma_{i}^2+e_{i2}\right)p_j\left(\mu_{i}+e_{i1}, \sigma_{i}^2+e_{i2}\right)}{\displaystyle\sum_{j=A}^{B}L\left(y_j|\mu_{i}, \sigma_{i}^2\right)p_j\left(\mu_{i}, \sigma_{i}^2\right)} $$
$$e_{i1} \sim N\left(0, 0.5\right) $$
$$e_{i2} \sim N\left(0, 0.002\right) $$

We accept μ*i+1 and σ*2i+1 when α meets the below conditions.
$$ \mu_{i+1}^* = \mu_{i} +e_{i1}\hspace{20mm}\alpha\geqq 1\ or\ \alpha\geqq e_{i3}$$
$$ \sigma_{i+1}^{*^2} = \sigma_{i}^2 +e_{i2}$$
 $$ e_{i3} \sim N\left(0, 1\right)$$

We reject the above μ* i+1 and σ*2i+1 and accept the below μ*i+1 and σ*2i+1 when α meets the below condition.
$$ \mu_{i+1}^* = \mu_{i}\hspace{30mm}\alpha<e_{i3}\ and\ \alpha<1$$
$$ \sigma_{i+1}^{*^2}=\sigma_{i}^2$$

      source code: Metropolis.java

import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import java.applet.Applet;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class Metropolis extends Applet implements ActionListener{

// variable set
private static final long serialVersionUID = 8565245775496766530L;
public static double exp = 1.0;
public static double var = 1.0;
public static double ratio = 10.0;
public static double u, d3, d4, d7, d8, d9, d10, d11, d12;
public static double[] s1 = new double[10000];
public static double[] s2 = new double[10000];
public static double[] s3 = new double[1000];
public static double[] s4 = new double[1000];
public static double[] se1 = new double[10000];
public static double[] se2 = new double[10000];
public static double[] d1 = new double[10000];
public static double[] d2 = new double[10000];
public static double[] d5 = new double[10000];
public static double[] d6 = new double[10000];
JTextField yx = new JTextField("1.0");
JTextField yn = new JTextField("1.0");
JTextField yr = new JTextField("10.0");
JLabel label1 = new JLabel("The Metropolis Sampler Frequency Distribution",JLabel.CENTER);
JLabel label2 = new JLabel("<html><body><font size=3>The Expectation of σ<sup>2</sup> (0<E(σ<sup>2</sup>)≤10<sup>8</sup>)</font></body></html>",JLabel.CENTER);
JLabel label3 = new JLabel("<html><body><font size=3>The Variance of σ<sup>2</sup> (0<Var(σ<sup>2</sup>)≤10<sup>8</sup>)</font></body></html>",JLabel.CENTER);
JLabel label4 = new JLabel("<html><body><font size=3>The Ratio of σ<sup>2</sup> to Var(μ<sub>j</sub>) (0<r≤10<sup>8</sup>)</font></body></html>", JLabel.CENTER);

public void init(){
label1.setPreferredSize(new Dimension(416,24));
label1.setFont(new Font("Serif",Font.BOLD,14));
add(label1);
label2.setPreferredSize(new Dimension(260,23));
label2.setFont(new Font("Serif",Font.BOLD,11));
add(label2);
yx.setPreferredSize(new Dimension(80,23));
add(yx);
label3.setPreferredSize(new Dimension(260,23));
label3.setFont(new Font("Serif",Font.BOLD,11));
add(label3);
yn.setPreferredSize(new Dimension(80,23));
add(yn);
label4.setPreferredSize(new Dimension(260,23));
label4.setFont(new Font("Serif",Font.BOLD,11));
add(label4);
yr.setPreferredSize(new Dimension(80,23));
add(yr);
yx.addActionListener(this);
yn.addActionListener(this);
yr.addActionListener(this);
}

public void actionPerformed(ActionEvent e){
if(e.getSource()==yx){
exp=Double.valueOf(yx.getText()).doubleValue();
if(exp <= 0 || exp > Math.pow(10.0,8)){
exp = 1.0;
}
}
if(e.getSource()==yn){
var = Double.valueOf(yn.getText()).doubleValue();
if(var <= 0 || var > Math.pow(10.0,8)){
var = 1.0;
}
}
if(e.getSource()==yr){ratio = Double.valueOf(yr.getText()).doubleValue();
if(ratio <= 0 || ratio > Math.pow(10.0,8))
{ratio = 10.0;}
}
yx.setText(""+exp);
yn.setText(""+var);
yr.setText(""+ratio);
repaint();
}

public void paint(Graphics g){

double z1,z2,ss1,ss2;
s1[0] = 0.0;
s2[0] = 1.0;
z1=function(s1[0],s2[0]);
for(int i=0;i<9999;i++){
se1[i]=normal.sampleNormal(0,0.5);
se2[i]=normal.sampleNormal(0,0.002);
ss1=s1[i]+se1[i];
ss2=s2[i]+se2[i];
z2=function(ss1,ss2);
if(z2/z1>=1){
s1[i+1]=ss1;
s2[i+1]=ss2;
z1=z2;
}
else if(z2/z1>=normal.sampleNormal(0,1)){
s1[i+1]=ss1;
s2[i+1]=ss2;
z1=z2;
}
else {
s1[i+1]=s1[i];
s2[i+1]=s2[i];
}
}

d1[5000]=s1[5000];
d2[5000]=s2[5000];
for(int i=5001;i<10000;i++){
d1[i]=d1[i-1]+s1[i];
d2[i]=d2[i-1]+s2[i];
}

d3=d1[9999]/5000;
d4=d2[9999]/5000;

d5[4999]=0;
d6[4999]=0;

for(int i=5000;i<10000;i++){
d5[i]=Math.pow((s1[i]-d3),2)+d5[i-1];
d6[i]=Math.pow((s2[i]-d4),2)+d6[i-1];
}

d7=d5[9999]/(5000-1);
d8=d6[9999]/(5000-1);

// variable set
int[] xxxx = new int[1000];
int[] yyyy = new int[1000];
int[] xxxx1 = new int[1000];
int[] yyyy1 = new int[1000];
double minss1 = s1[5000];
double maxss1 = s1[5000];
double minss2 = s2[5000];
double maxss2 = s2[5000];

for(int i=5000;i<10000;i++){
if(s1[i]>maxss1){
maxss1 = s1[i];
}
}

for(int i=5000;i<10000;i++){
if(s1[i]<minss1){
minss1 = s1[i];
}
}

for(int i=5000;i<10000;i++){
if(s2[i]>maxss2){
maxss2 = s2[i];
}
}

for(int i=5000;i<10000;i++){
if(s2[i]<minss2){
minss2 = s2[i];
}
}
for(int i=0;i<1000;i++){
s3[i]=0;
s4[i]=0;
}

double aaa=(maxss1-minss1)/1000;
double bbb=(maxss2-minss2)/1000;
for(int i=5000;i<10000;i++){
for(int j=0;j<1000;j++){
if(s1[i] >= (minss1+aaa*j) && s1[i] < minss1+aaa*(j+1))
s3[j]=(s3[j]+1.0);
}
}

for(int i=5000;i<10000;i++){
for(int j=0;j<1000;j++){
if(minss2+bbb*j<=s2[i] && s2[i] < minss2+bbb*(j+1))
s4[j]=s4[j]+1;
}
}

// variable set
double minss3 = s3[0];
double maxss3 = s3[0];
double minss4 = s4[0];
double maxss4 = s4[0];

for(int i=0;i<1000;i++){
if(maxss3<s3[i]){
maxss3 = s3[i];
}
}

for(int i=0;i<1000;i++){
if(s3[i]<minss3){
minss3 = s3[i];
}
}

for(int i=0;i<1000;i++){
if(s4[i]>maxss4){
maxss4 = s4[i];
}
}

for(int i=0;i<1000;i++){
if(s4[i]<minss4){
minss4 = s4[i];
}
}

double yyy = maxss3-minss3;
double yyy1 = maxss4-minss4;

for(int i=0;i<1000;i++){
xxxx[i] = (int)(i*351/1000)+33;
yyyy[i] = 474-(int)((s3[i]-minss3)*351/yyy);
xxxx1[i] = (int)(i*351/1000)+33;
yyyy1[i] = 474-(int)((s4[i]-minss4)*351/yyy1);
}

Graphics2D g2 = (Graphics2D)g;
GradientPaint gp1 = new GradientPaint(0, 0, new Color(154,181,228), 0,470,new Color(225,232,245), true);
g2.setPaint(gp1);
g2.fillRect(0,0,416,503);
super.paint(g);
GradientPaint gp2 = new GradientPaint(0, 33, new Color(225,232,245), 0,351,new Color(154,181,228),true);
g2.setPaint(gp2);
g2.fillRect(33,123,354,351);
GradientPaint gp4 = new GradientPaint(33, 227, new Color(192,88,77), 33,418,new Color(160,82,45), true);
g2.setPaint(gp4);
for (int i=0;i<1000;i++){
g2.drawLine(xxxx[i], 474, xxxx[i], yyyy[i]);
}
DecimalFormat df = new DecimalFormat("0.00");
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.setColor (new Color(0,0,0));
g2.drawString("n = 5000",280,157);
g2.setColor (new Color(0,0,0));
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("E(μ",280,177);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("*",300,176);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("|y) =",305,177);
g2.drawString(df.format(d3),335,177);
        g2.drawString("Var(μ",280,197);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("*",312,196);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("|y) =",317,197);
g2.drawString(df.format(d7),347,197);
g2.setColor (new Color(0,0,0));
g2.drawString("E(σ",280,217);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("*",300,216);
g2.setFont(new Font ("Serif",Font.BOLD,8));
g2.drawString("2",305,212);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("|y) =",310,217);
g2.drawString(df.format(d4),340,217);
g2.drawString("Var(σ",280,237);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("*",312,236);
g2.setFont(new Font ("Serif",Font.BOLD,8));
g2.drawString("2",317,232);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("|y) =",322,237);
g2.drawString(df.format(d8),352,237);
g2.drawString("E(y) = -0.11",280,257);
g2.drawString("Var(y) = 1.52",280,277);
g2.setColor (new Color(0,0,0));
g2.drawString("F",15,143);
g2.setColor (new Color(79,129,189));
g2.setColor (new Color(192,88,77));
g2.drawString("μ",360,488);
}

public static double function(double x, double y){
double z1;
double z2;
double k0;
double k1;
double u1;
double u2;
double d01=1;
double d02=1;
double[] f1= new double[10];
double[] f2={-2.18,-1.19,-0.74,-1.2,-2.53,-0.5,0.09,0.31,-1.71,-0.67};
double[] f3= new double[10];
double[] f4={0.59,0.13,1.22,0.45,-0.22,0.15,1.5,1.06,1.32,1.88};
for(int i=0;i<10;i++){
f1[i]=Math.pow(2*Math.PI*y,(-0.5))*Math.exp(-Math.pow(f2[i]-x,2)/(2*y));
d01=d01*f1[i];
}
for(int i=0;i<10;i++){
f3[i]=Math.pow(2*Math.PI*y,(-0.5))*Math.exp(-Math.pow(f4[i]-x,2)/(2*y));
d02=d02*f3[i];
}
u1=Math.pow((2*Math.PI)*(y/ratio),(-0.5))*(Math.exp(-Math.pow((x+0.7),2)/(2*y/ratio)));
u2=Math.pow((2*Math.PI)*(y/ratio),(-0.5))*(Math.exp(-Math.pow((x-0.7),2)/(2*y/ratio)));
 k0=Math.pow(exp,2)/var+2;
k1=Math.pow(exp,3)/var+exp;
z1=Math.pow(k1,k0)/GammaF.gamma(k0)*Math.pow(y,(-k0-1))*Math.exp((-k1)/(y))*u1;
z2=Math.pow(k1,k0)/GammaF.gamma(k0)*Math.pow(y,(-k0-1))*Math.exp((-k1)/(y))*u2;
if(y>=0){
if(z1>=0 && z2>=0){
if(u1>=0 && u2>=0)
return (d01*z1+d02*z2)/2;
else return 0;
}
else return 0;
}
else return 0;
}
}

         source code: normal.java

import java.util.*;

public class normal {
private static Random rnd = new Random(Calendar.getInstance().
getTimeInMillis()+Thread.currentThread().getId());
private static double u;
public static double sampleNormal(double e0, double e1) {
double e2;
e2=Math.pow(e1,(0.5));
u=e2*rnd.nextGaussian()+e0;
return u;
}
}

            GammaF.java

// See the below website, copy and paste the class "Gamma".
// Then modify the code as necessary.
//
// http://www.cs.princeton.edu/introcs/91float/Gamma.java.html
//
// I express my appreciation for Robert Sedgewick
// and Kevin Wayne.

In conclusion, the posterior distribution is bimodal because the conditional likelihood function is set to the bimodal form and the prior distribution is bimodal. The variances of μ and σ2 on the posterior distribution is smaller than the variances of μ and σ2 on the prior distribution because the posterior distribution is in proportion to the product of the conditional likelihood function and depends on the scatteration of the data.

Finally I am happy to assist you in coding and simulating a random process with the MCMC algorithm in JAVA.

調査再開、パート4。

| コメント(0) | トラックバック(0)

 今回もやや重目のアプレットを3つ程用いたため、
スムーズに眺めるには、適切なソースコードの配置
により、アプレットの表示に掛かる時間を然程意識
させない工夫が必要になってくる。

 まだ原稿をアップしていないが、数式、コード、
アプレットといった説明を分かり易くするための
要素を全て揃えていない現状を鑑みると、これから
詰めの作業に移るのだろうが、じっくり進めるつもり。

 ここからが今日の課題。

 英検対策は読解とリス。正答率は、読解が4/6で、
リスが6/10。読み込むポイントがずれていると解答
も異なったものがでてくるため、語彙を強化すること
により乗り切りたいところ。

 仏検対策は動詞の活用と前置詞。前置詞の正答率は、
8/33。熟語表現を増やすべく、これまでやったことの
見直しを挟みたいところかな。

 明日もがんばろう。

 では。

調査再開、パート3。

| コメント(0) | トラックバック(0)

 多峰分布を複数の分布が混じっている状態と見ると
正規分布の線形結合から作成しても構わないだろうと
漠然と考えたくなる時もあるが、まあこの辺りをもう
少しじっくりと進める必要があるかな。

 それで事前分布を作ってみたは良いがどうもその
形状がイメージと異なり、まあそれで説明できる
ことがあればそれで良しなのだが、暫く試行錯誤が
続くかもしれないとの見通しを抱くときがある。

 ここからが今日の課題。

 英検対策は読解とリス。正答率は、読解が
2/4で、リスが6/10。リスの正答率を高める必要
があり、まだまだこれから。

 仏検対策は語彙と前置詞。前置詞の正答率は、
11/28。locution figée, locution verbaleがまだまだ
押さえられておらず、精進あるのみだろう。

 明日もがんばろう。

 では。

調査再開、パート2。

| コメント(0) | トラックバック(0)

 具体化するにはもう少し理論を深める必要が
ありそうだが、多峰分布の作り方についてはある
程度目処がついている。

 どうシミュレートする環境を作るかについては
もう暫く時間が掛かりそうだが、じっくり進める
方針で問題ないだろう。

 ここからが今日の課題。

 英検対策は読解とエッセイ。読解の正答率は、
6/6。語彙が鍵になるため多方面の文献を貪欲に
読み込む必要があるだろう。

 独検対策は語彙と聞き取り。zügeln, 馭する,
ぎょする、der Zuvogel, 候鳥, こうちょう、
zwicken, 抓る, つねる、das Zwielicht, 薄明,
はくめい、der Zwilling, 雙生児, そうせいじ、
等の漢字の読み方を調べる必要があったこと
を追記する。

 明日もがんばろう。

 では。

調査再開、パート1。

| コメント(0) | トラックバック(0)

 後半戦に移る訳だが前半戦をもう少し深めた内容に
した方が良いとの見方がある中、その分後半戦に生か
せることがあれば良いかと楽観的に捉えることにした。

 理論は理解しているつもりだが、実際にコーディング
してみると試行錯誤の連続は避けられないだろうとの
見通しもあり、じっくり進める方針に変わりはない。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
5/10。waft, 風に乗ってくる匂い、waver, 迷う、
welter, turmoil, 混乱、whimsical, 気まぐれな、
volatile, 変わりやすい、等で失点しており、周回
が必要か。

 独検対策は語彙と聞き取り。die Wölbung, 拱形,
きょうけい、der Zapfen, 毬果, もうか、das Zelt,
日覆, ひおい、das Zepter, 王笏, おうしゃく、等の
漢字の読み方を調べる必要があったことを追記する。

 明日もがんばろう。

 では。

加筆修正、パート2。

| コメント(0) | トラックバック(0)

 行間を埋めるべく背景説明を加えるべき箇所が多岐
に亘るが、じっくり取り組んでいるため次のステップ
に移るには暫し時間が掛かるかもしれない。

 そうは言ってもイメージは出来ているので後は
具体化する際に生じる試行錯誤の連続をどう対処
するかといったあたりになろうか。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
6/16。vaunt, boast, 自慢する、venerate, revere,
〜を敬う、veritable, 本当の、vigilant, 絶えず警戒
している、verisimilitude, 本当らしさ、vitiate, 〜を
無効にする、vilify, 中傷する、vexation, 悩ますこと、
virulent, 有毒な、viscous, 粘性の、等で失点しており、
周回が必要か。

 独検対策は語彙と聞き取り。wandeln, 逍遥する,
しょうようする、die Warte, 望楼, ぼうろう、der
Weber, 織匠, しょくしょう、weilen, 逗留する,
とうりゅうする、welk, 凋んだ, しぼんだ、welken,
萎む, しぼむ、wickeln, 捲く, まく、der Wiederwille,
嫌厭, けんえん、等の漢字の読み方を調べる必要が
あったことを追記する。

 明日もがんばろう。

 では。

加筆修正、パート1。

| コメント(0) | トラックバック(0)

 現在コーディングがメインの構成になっているが、
これから背景知識と解釈を加えていきもう少し体裁
の良いものに仕上げたいとの思いがある。

 そしてこれはまだ話の前半にあたるもので後半
が残っている以上ある程度の段階で切り上げる必要
があるかもしれない。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
6/20。transient, 束の間の、trenchant, 鋭い、travesty,
戯画化、torrid, 熱烈な、turbid, 濁った、tractable,
従順な、tout, 〜を褒めちぎる、tumid, swollen, 膨れ
上がった、truculent, 喧嘩っ早い、upbraid, 〜をひどく
叱る、tyro, novice, 初心者、umbrage, resentment,
憤り、untoward, unseemly, 不適当な、unfeigned,
本物の、等で失点しており、周回が必要か。

 仏検対策は語彙と前置詞。前置詞の正答率は、
13/29。vaut mieux inf (que subj), 〜するほうが良い、
faire ses valises, 旅行の準備をする、varier dans
ses résponses, 言を左右する、avec véhémence,
熱っぽく、faire venir qn, 人を呼ぶ、un nouveau
venu, 新顔、à la vérité, 実を言うと、un vernis
à ongles, マニキュア、être versé en qc, 〜に精通
している、les légumes verts, 生野菜、de vive
voix, 口頭で、un vilain temps, いやな天気、Vous
voyez?, どうです?、Voyons!, さあ!、等を押さ
える必要がある。

 次回の投稿は9/23(木)です。

 では。

修正に次ぐ修正。

| コメント(0) | トラックバック(0)

 上下のスクロールとアプレットの描画との相性を
勘案する必要があるが、ソースコードの貼り付けで
凌ぐ手もあり、調整はこれから。

 事後分布の計算に時間が掛かっている様で、それ
は仕方がない面もあるが、何れにせよ何らかの対策
を打ち出す必要があるだろう。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
8/22。tacit, 暗黙の、suppliant, 嘆願するような、
table, 〜を棚上げにする、surfeit, overindulgence,
〜の食べ過ぎ、taciturn, 無口な、sycophant, おべっか
使い、talisman, charm, お守り、tenuous, 内容のない、
tawdry, 安物、tirade, 激しい非難の長演説、tender,
〜を提出する、toady, おべっか使い、torpid, sluggish,
無気力な、怠惰な、等で失点しており、周回が必要か。

 仏検対策は語彙と前置詞。au sujet de n, 〜に関して、
les heures supplémentaire, 残業、avoir qc sur soi, 身に
つけて持つ、une fois sur deux, 2度に1度は、une surface
de l'eau, 水面、être surmené, へとへとである、se donner
pour tâche de inf, 〜するのを自分の義務と考える、une
tour de taille, ウェスト、les hauts talons, ハイヒール、
tant de n, それ程多くの、tant que, 〜する限り、un tas de,
たくさんの、tel n que, 〜である程の、tellement ... que ind,
非常に...なので、Tiens!, おや!、Tenez!, ほら!、等を押さ
える必要がある。

 明日もがんばろう。

 では。

<Caution>

・ This article uses three heavy java applets. So the images or the applets on your browser may act up under certaincircumstance.

・ How to deal with the problem is in waiting 30-60 seconds and not touching the keyboard and the mouse to display the correct images or applets on the browser.

This article is theoretically indebted to the scrupulous works of Yoshiyuki Wakui, Hiroshi Watanabe, and Takeshi Amemiya, which have a lot of lucid explanations and I'd very much appreciate their useful descriptions. In addition, I'd like to express my gratitude for some helpful websites, such as http://codezine.jp/article/detail/116 as for how to make three-dimensional graph in JAVA and so on.

First I'd tentatively like to outline the situation we were put in with your agreement. A busy person generated normal random numbers with a computer. Then his phone rang. After he had answered the phone, someone called out to him. After he had reluctantly wrapped up something urgent, he realized that he clean forgot the variance of the normal random variables. He barely remembered the mean and the form of the distribution. Unfortunately, he needed to generate the additional normal random numbers which followed the almost same normal distribution.

1. The Data Set The data set he generated is given below.

    n     1  2  3  4  5 
    y     0.58  -2.23  0.86  0.16  -0.20 
    n     6  7  8  9  10 
    y     0.54  1.52  -0.69  0.66  -1.75 
    n     11  12  13  14  15 
    y     -1.24  0.32  -0.58  -0.83  -0.74 
    n     16  17  18  19  20 
    y     -2.01  -0.71  -0.05  0.47  2.30 

The sample mean is about -0.18 and the unbiased sample variance is about 1.33. These random variables y are actually generated from the normal distribution N(0,1) and he knew the population mean of y was 0 but didn't know the population variance of σ2 was 1. That is to say we pretend we don't know the population variance of σ2 is 1 and keep carrying out the below experiment on the above condition.

2. The Estimation of The Prior Distribution
I supposed that the mean μ of the random variables followed the normal distribution, that the population mean of μ is 0, that the population variance of μ is in proportion to the population variance of the random variables, and that the variance σ2 of the random variables followed the inverse gamma distribution. The example of the prior distribution is given below.
$$p\left( \theta \right) = p\left( \mu \right) p \left( \sigma^2 \right)$$

We substitute both p(μ) and p(σ2) in the above equation to find the prior distribution.
$$p\left( \mu \right) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\left( -\frac{\mu^2}{\frac{2\sigma^2}{m_0}} \right)} $$
$$p\left( \sigma^2 \right) = \frac{\beta^\alpha}{\Gamma\left(\alpha\right)} \left( \frac{1}{\sigma^2} \right)^{\alpha+1}  \exp{ \left( -\frac{\beta}{\sigma^2} \right)} $$

We also substitute the parameters for both E(σ2) and Var(σ2) in the below equations to find the value of both α and β.
$$E\left( \sigma^2 \right) = \frac{\beta}{\alpha-1}  \hspace{10mm}\alpha > 1 $$
$$Var\left( \sigma^2 \right) = \frac{\beta^2}{\left( \alpha+1 \right)^2 \left( \alpha-2 \right)} \hspace{10mm}\alpha > 2 $$

      source code: PriorDistribution.java

import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class PriorDistribution extends Applet implements ActionListener{

// variable set
private static final long serialVersionUID = 4049271078937921933L;
final static int StartingX=50,StartingY=527;
final static String[] rulerX = {"",""," 0.2",""," 0.6",""," 1.0",""," 1.4",""," 1.8",""};
final static String[] rulerY = {"",""," -1.0",""," -0.5",""," 0",""," 0.5",""," 1.0",""};
final static String[] rulerZ = {"","","","",""," 0","","","","","","","",""};
final int EndingX=StartingX+transformation(120,120,120).x;
final int EndingY=StartingY+transformation(120,-120,-120).y;
public int[] SmallestInnerPart=new int[EndingX+1];
public int[] LargestInnerPart=new int[EndingX+1];
public static double exp = 1.0;
public static double var = 1.0;
public static double ratio = 3.0;
JTextField yx = new JTextField("1.0");
JTextField yn = new JTextField("1.0");
JTextField yr = new JTextField("3.0");
JLabel label1 = new JLabel("The Prior Distribution", JLabel.CENTER);
JLabel label2 = new JLabel("<html><body><font size=3>The Expectation of σ<sup>2</sup>(0<E(σ<sup>2</sup>)≤2.0)</font></body></html>", JLabel.CENTER);
JLabel label3 = new JLabel("<html><body><font size=3>The Variance of σ<sup>2</sup> (0<Var(σ<sup>2</sup>)≤10<sup>8</sup>)</font></body></html>", JLabel.CENTER);
    JLabel label4 = new JLabel("<html><body><font size=3>    The Ratio of σ<sup>2</sup> to Var(μ) (0<r≤10<sup>8</sup>)</font></body></html>",JLabel.CENTER);

public void init(){

label1.setPreferredSize(new Dimension(400,24));
label1.setFont(new Font("Serif",Font.BOLD,15));
add(label1);
label2.setPreferredSize(new Dimension(260,23));
label2.setFont(new Font("Serif",Font.BOLD,11));
add(label2);
yx.setPreferredSize(new Dimension(120,23));
add(yx);
label3.setPreferredSize(new Dimension(260,23));
label3.setFont(new Font("Serif",Font.BOLD,11));
add(label3);
yn.setPreferredSize(new Dimension(120,23));
add(yn);
label4.setPreferredSize(new Dimension(260,23));
label4.setFont(new Font("Serif",Font.BOLD,11));
add(label4);
yr.setPreferredSize(new Dimension(120,23));
add(yr);
yx.addActionListener(this);
yn.addActionListener(this);
yr.addActionListener(this);
}

public void actionPerformed(ActionEvent e){
if(e.getSource()==yx){
exp = Double.valueOf(yx.getText()).doubleValue();
if(exp <= 0 || exp > 2.0){exp=1.0;
}
}
if(e.getSource()==yn){
var = Double.valueOf(yn.getText()).doubleValue();
if(var <= 0 || var > Math.pow(10.0,8)){var=1.0;
}
}
if(e.getSource()==yr){
ratio = Double.valueOf(yr.getText()).doubleValue();
if(ratio <= 0 || ratio > Math.pow(10.0,8)){ratio=3.0;
}
}
yx.setText(""+exp);
yn.setText(""+var);
yr.setText(""+ratio);
repaint();
}

public void paint(Graphics g){

Point dot,dot1,dot2,dot3,dot4,dot5,dot6;

Graphics2D g2 = (Graphics2D)g;
GradientPaint gp1 = new GradientPaint(0, 0, new Color(154,181,228), 0,470,new Color(225,232,245), true);
g2.setPaint(gp1);
g2.fillRect(0,0,460,447);
super.paint(g);

// x axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
 dot2=transformation(120,-120,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
for(int i=0;i<21;i++){
dot1=transformation((120/10*i-120),-120,0);
if(i % 4==0){
    dot2=transformation((120/10*i-120),(120-10),0);
g.setColor(new Color(128,128,128));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g2.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerX[i/2],dot2.x-48,dot2.y+15);
if(i==8)
g.drawString("σ",dot2.x+28,dot2.y+30);
g2.setFont(new Font ("SanSerif",Font.PLAIN,8));
if(i==8) g.drawString("2",dot2.x+37,dot2.y+23);
}
}

// y axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(-120,120,0);
dot3=transformation(-120,120,0);
dot4=transformation(-120,120,210);
dot5=transformation(120,-120,0);
dot6=transformation(120,120,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
g.drawLine(dot5.x,dot5.y,dot6.x,dot6.y);
for(int i=0;i<210;i=i+1){
dot3=transformation(-119,120,i);
dot4=transformation(120,120,i);
g.setColor(new Color(154,181,228));
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
}
g.setColor(new Color(128,128,128));
for(int i=3;i<10;i++){
dot3=transformation(-120,120,(12/4*(i+3)-15)*10);
dot4=transformation(120,120,(12/4*(i+3)-15)*10);
   g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
}
for(int i=0;i<21;i++){
dot1=transformation(120,(12*i-120),0);
if(i % 4==0){
dot2=transformation((12+1)*10,(12*i-120),0);
g.setColor(new Color(128,128,128));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerY[i/2],dot2.x-10,dot2.y+13);
if(i==8) g.drawString("μ",dot2.x+38,dot2.y+16);
}
}

// z axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(-120,-120,210);
dot3=transformation(-120,119,210);
dot4=transformation(-120,119,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot2.x,dot2.y,dot3.x,dot3.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
for(int i=0;i<240;i=i+1){
g.setColor(new Color(154,181,228));
dot5=transformation(-120,(-119+i),210);
dot6=transformation(-120,(-119+i),0);
g.drawLine(dot5.x,dot5.y,dot6.x,dot6.y);
}
g.setColor(new Color(128,128,128));
for(int i=2;i<10;i++){
dot1=transformation(-120,-120,(30*(i+3)-150));
dot2=transformation(-130,-120,(30*(i+3)-150));
dot3=transformation(-120,-119,(30*(i+3)-150));
dot4=transformation(-120,120,(30*(i+3)-150));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
g2.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerZ[(i+3)],dot2.x-38,dot2.y+5);
if(i==5) g.drawString("L",dot2.x-25,dot2.y-110);
}

// Coloring
for(int i=0;i<=EndingX;i++){
SmallestInnerPart[i]=EndingY;
LargestInnerPart[i]=0;
}
dot=new Point();
for(double x=120;x>=-120;x-=0.2)
for(double y=-120;y<=120;y+=0.2){
double transX=x/120+1;
double transY=y/120;
double transZ=function(transX,transY);
double z=transZ*3.8;
dot=transformation(x,y,z);
if(dot.y<SmallestInnerPart[dot.x]){
SmallestInnerPart[dot.x]=dot.y;
g.setColor(gradation(z));
g.drawRect(dot.x,dot.y,1,1);
}
if(dot.y>LargestInnerPart[dot.x]){
LargestInnerPart[dot.x]=dot.y;
g.setColor(new Color(128,128,128));
g.drawRect(dot.x,dot.y,1,1);
}
}
}

public static double function(double x, double y){
double z;
double k0;
double k1;
double u;
u=(Math.pow((2*Math.PI)*(x/ratio),(-0.5)))*Math.exp(-Math.pow((y-0),2)/(2*x/ratio));
 k0=Math.pow(exp,2)/var+2;
k1=Math.pow(exp,3)/var+exp;
z=Math.pow(x,(-k0-1))*Math.exp((-k1)/(x))*u;
if(x>=0){
if(z>=0){
if(u>=0)
return 150*z;
else return 0;
}
else return 0;
}
else return 0;
}

public Color gradation(double z){
int d,r,g,b;
z=z*5.2;
if(z>=0) d=(int)z % 256;
else d=255-(-(int)z % 256);
int c=(int)(d/85.334);
switch(c){
case 0: r=79+76*d/86;
g=129+58*d/86;
        b=189-100*d/86;
break;
case 1: r=155+37*(d-86)/85;
g=187-99*(d-86)/85;
b=89-12*(d-86)/85;
break;
case 2: r=192-113*(d-171)/84;
g=88+41*(d-171)/84;
b=77+112*(d-171)/84;
break;
default: r=0; g=0; b=0;
break;
}
Color color=new Color(r,g,b);
return color;
}

public Point transformation(double x,double y,double z){
Point dot=new Point();
dot.x=StartingX+(int)((x+120)+Math.cos(Math.toRadians(30))*(y+120)/2);
dot.y=StartingY-(int)(Math.sin(Math.toRadians(30))*(y+120)/2+(z+120));
return dot;
}
}

3. The Estimation of The Posterior Distribution The example of the conditional likelihood function is given below.
$$L\left( y|\theta \right) = \prod_{i=1}^{20}{ \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\left( -\frac{\left( y_i-\mu\right)^2}{2\sigma^2} \right)} }$$

The posterior distribution is in proportion to the product of the conditional likelihood function multiplied by the prior distribution and its example is given below.
$$p\left( \theta|y \right) \varpropto L\left( y|\theta \right) p \left( \theta \right) $$

      source code: PosteriorDistribution.java

import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class PosteriorDistribution extends Applet implements
ActionListener{

// variable set
private static final long serialVersionUID = -6251476488227240006L;
final static int StartingX=50,StartingY=527;
final static String[] rulerX = {"",""," 0.2",""," 0.6",""," 1.0",""," 1.4",""," 1.8",""};
final static String[] rulerY = {"",""," -1.0",""," -0.5",""," 0",""," 0.5",""," 1.0",""};
final static String[] rulerZ = {"","","","",""," 0","","","","","","","",""};
final int EndingX=StartingX+transformation(120,120,120).x;
final int EndingY=StartingY+transformation(120,-120,-120).y;
public int[] SmallestInnerPart=new int[EndingX+1];
public int[] LargestInnerPart=new int[EndingX+1];
public static double exp = 1.0;
public static double var = 1.0;
public static double ratio = 3.0;
JTextField yx = new JTextField("1.0");
JTextField yn = new JTextField("1.0");
JTextField yr = new JTextField("3.0");
JLabel label1 = new JLabel("The Posterior Distribution", JLabel.CENTER);
JLabel label2 = new JLabel("<html><body><font size=3>The Expectation of σ<sup>2</sup> (0<E(σ<sup>2</sup>)≤2.0)</font></body></html>", variJLabel.CENTER);
JLabel label3 = new JLabel("<html><body><font size=3>The Variance of σ<sup>2</sup> (0<Var(σ<sup>2</sup>)≤10<sup>8</sup>)</font></body></html>",JLabel.CENTER);
JLabel label4 = new JLabel("<html><body><font size=3>The Ratio of σ<sup>2</sup> to Var(μ) (0<r≤10<sup>8</sup>)</font></body></html>",JLabel.CENTER);

public void init(){

label1.setPreferredSize(new Dimension(400,24));
label1.setFont(new Font("Serif",Font.BOLD,15));
add(label1);
label2.setPreferredSize(new Dimension(260,23));
label2.setFont(new Font("Serif",Font.BOLD,11));
add(label2);
yx.setPreferredSize(new Dimension(120,23));
add(yx);
label3.setPreferredSize(new Dimension(260,23));
label3.setFont(new Font("Serif",Font.BOLD,11));
add(label3);
yn.setPreferredSize(new Dimension(120,23));
add(yn);
label4.setPreferredSize(new Dimension(260,23));
label4.setFont(new Font("Serif",Font.BOLD,11));
add(label4);
yr.setPreferredSize(new Dimension(120,23));
add(yr);
yx.addActionListener(this);
yn.addActionListener(this);
yr.addActionListener(this);
}

public void actionPerformed(ActionEvent e){
if(e.getSource()==yx){
exp = Double.valueOf(yx.getText()).doubleValue();
if(exp <= 0 || exp > 2.0){exp=1.0;
}
}
if(e.getSource()==yn){
var = Double.valueOf(yn.getText()).doubleValue();
if(var <= 0 || var > Math.pow(10.0,8)){
var=1.0;
}
}
if(e.getSource()==yr){
ratio = Double.valueOf(yr.getText()).doubleValue();
if(ratio <= 0 || ratio >Math.pow(10.0,8)){ratio=3.0;
}
}
yx.setText(""+exp);
yn.setText(""+var);
yr.setText(""+ratio);
repaint();
}

public void paint(Graphics g){

Point dot,dot1,dot2,dot3,dot4,dot5,dot6;

Graphics2D g2 = (Graphics2D)g;
GradientPaint gp1 = new GradientPaint(0, 0, new Color(154,181,228), 0,470,new Color(225,232,245), true);
g2.setPaint(gp1);
g2.fillRect(0,0,460,447);
super.paint(g);

// x axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(120,-120,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
for(int i=0;i<21;i++){
dot1=transformation((120/10*i-120),-120,0);
if(i % 4==0){
dot2=transformation((120/10*i-120),(-120-10),0);
g.setColor(new Color(128,128,128));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g2.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerX[i/2],dot2.x-48,dot2.y+15);
if(i==8)
g.drawString("σ",dot2.x+28,dot2.y+30);
g2.setFont(new Font("SanSerif",Font.PLAIN,8));
if(i==8) g.drawString("2",dot2.x+37,dot2.y+23);
}
}

// y axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(-120,120,0);
dot3=transformation(-120,120,0);
dot4=transformation(-120,120,210);
dot5=transformation(120,-120,0);
dot6=transformation(120,120,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
g.drawLine(dot5.x,dot5.y,dot6.x,dot6.y);
for(int i=0;i<210;i=i+1){
dot3=transformation(-119,120,i);
dot4=transformation(120,120,i);
g.setColor(new Color(154,181,228));
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
}
g.setColor(new Color(128,128,128));
for(int i=3;i<10;i++){
dot3=transformation(-120,120,(12/4*(i+3)-15)*10);
dot4=transformation(120,120,(12/4*(i+3)-15)*10);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
}
for(int i=0;i<21;i++){
dot1=transformation(120,(12*i-120),0);
if(i % 4==0){
dot2=transformation((12+1)*10,(12*i-120),0);
g.setColor(new Color(128,128,128));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerY[i/2],dot2.x-10,dot2.y+13);
if(i==8) g.drawString("μ",dot2.x+38,dot2.y+16);
}
}

// z axis
g.setColor(new Color(128,128,128));
dot1=transformation(-120,-120,0);
dot2=transformation(-120,-120,210);
dot3=transformation(-120,119,210);
dot4=transformation(-120,119,0);
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot2.x,dot2.y,dot3.x,dot3.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
for(int i=0;i<240;i=i+1){
g.setColor(new Color(154,181,228));
dot5=transformation(-120,(-119+i),210);
dot6=transformation(-120,(-119+i),0);
g.drawLine(dot5.x,dot5.y,dot6.x,dot6.y);
}
g.setColor(new Color(128,128,128));
for(int i=2;i<10;i++){
dot1=transformation(-120,-120,(30*(i+3)-150));
dot2=transformation(-130,-120,(30*(i+3)-150));
dot3=transformation(-120,-119,(30*(i+3)-150));
dot4=transformation(-120,120,(30*(i+3)-150));
g.drawLine(dot1.x,dot1.y,dot2.x,dot2.y);
g.drawLine(dot3.x,dot3.y,dot4.x,dot4.y);
g2.setFont(new Font ("SanSerif",Font.PLAIN,12));
g.drawString(rulerZ[(i+3)],dot2.x-38,dot2.y+5);
if(i==5) g.drawString("L",dot2.x-25,dot2.y-110);
}

// Coloring
for(int i=0;i<=EndingX;i++){
SmallestInnerPart[i]=EndingY;
LargestInnerPart[i]=0;
}
dot=new Point();
for(double x=120;x>=-120;x-=0.2)
for(double y=-120;y<=120;y+=0.2){
double transX=x/120+1;
double transY=y/120;
double transZ=function(transX,transY);
double z=transZ*3.8;
dot=transformation(x,y,z);
if(dot.y<SmallestInnerPart[dot.x]){
SmallestInnerPart[dot.x]=dot.y;
g.setColor(gradation(z));
g.drawRect(dot.x,dot.y,1,1);
}
if(dot.y>LargestInnerPart[dot.x]){
LargestInnerPart[dot.x]=dot.y;
g.setColor(new Color(128,128,128));
g.drawRect(dot.x,dot.y,1,1);
}
}
}

public static double function(double x, double y){
double z;
double k0;
double k1;
double u;
double d0=1;
double[] d1= new double[21];
double[] d2={0.58,-2.23,0.86,0.16,-0.20,0.54,1.52,-0.69,0.66,-1.75,-1.24,0.32,-0.58,-0.83,-0.74,-2.01,-0.71,-0.05,0.47,2.30};
for(int i=0;i<20;i++){
d1[i]=Math.pow(2*Math.PI*x,(-0.5))*Math.exp(-Math.pow((d2[i]-y),2)/(2*x));
d0=d0*d1[i];
}
u=(Math.pow((2*Math.PI)*(x/ratio),(-0.5)))*Math.exp(-Math.pow((y-0),2)/(2*x/ratio));
k0=Math.pow(exp,2)/var+2;
k1=Math.pow(exp,3)/var+exp;
z=160000000*Math.pow(x,(-k0-1))*Math.exp((-k1)/(x))*u;
if(x>=0){
if(z>=0){
if(u>=0)
return 100000000*d0*z;
else return 0;
}
else return 0;
}
else return 0;
}

public Color gradation(double z){
int d,r,g,b;
z=z*5.2;
if(z>=0) d=(int)z % 256;
else d=255-(-(int)z % 256);
int c=(int)(d/85.334);
switch(c){
case 0: r=79+76*d/86;
  g=129+58*d/86;
   b=189-100*d/86;
break;
case 1: r=155+37*(d-86)/85;
      g=187-99*(d-86)/85;
      b=89-12*(d-86)/85;
break;
case 2: r=192-113*(d-171)/84;
      g=88+41*(d-171)/84;
      b=77+112*(d-171)/84;
break;
default: r=0; g=0; b=0;
break;
}
Color color=new Color(r,g,b);
return color;
}

public Point transformation(double x,double y,double z){
Point dot=new Point();
dot.x=StartingX+(int)((x+120)+Math.cos(Math.toRadians(30))*(y+120)/2);
dot.y=StartingY-(int)(Math.sin(Math.toRadians(30))*(y+120)/2+(z+120));
return dot;
}
}

4. The Gibbs Sampler Algorithm
I am most grateful to the helpful website, MY STRUGGLE, and the URL is given below.
http://vyshemirsky.blogspot.com/2007/11/sample-from-gamma-distribution-in-java.html
The example of the Gibbs sampler is given below.
$$\mu^*_{i+1}\sim N\left(\frac{n\bar{y}}{r+n},\frac{\sigma^{*^2}_i}{r}\right)$$
$$\frac{1}{\sigma^{*^2}_{i+1}}\sim Gamma\left(k,\theta_{i+1}\right)$$

We substitute the shape parameter k and the scale parameter θi+1 in the probability density function of the inverse gamma distribution and I provisionally set σ1*2 to 1.
$$k=\frac{\left\{E\left(\sigma^2\right)\right\}^2}{Var\left(\sigma^2\right)}+\frac{5}{2}$$
$$\theta_{i+1}=\frac{2}{{\displaystyle2\left\{\frac{E\left(\sigma^2\right)^3}{Var\left(\sigma^2\right)}+E\left(\sigma^2\right)\right\}+\sum^{20}_{j=1}\left(y_j-\bar{y}\right)^2+\frac{rn}{r+n}\bar{y}^2+\left(r+n\right)\left(u^*_{i+1}-\frac{r\bar{y}}{r+n} \right)^2}}$$

      source code: GibbsSampler.java

import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import java.applet.Applet;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class GibbsSampler extends Applet implements ActionListener{

// variable set
private static final long serialVersionUID = -729195055739028464L;
public static double exp = 1.0;
public static double var = 1.0;
public static double m0 = 3.0;
public static double u, d3, d4, d7, d8, d9, d10, d11, d12;
public static double[] s1 = new double[10000];
public static double[] s2 = new double[10000];
public static double[] s3 = new double[1000];
public static double[] s4 = new double[1000];
public static double[] d1 = new double[10000];
public static double[] d2 = new double[10000];
public static double[] d5 = new double[10000];
public static double[] d6 = new double[10000];
JTextField yx = new JTextField("1.0");
JTextField yn = new JTextField("1.0");
JTextField yr = new JTextField("3.0");
JLabel label1 = new JLabel("Gibbs Sampler Frequency Distribution",JLabel.CENTER);
JLabel label2 = new JLabel("<html><body><font size=3>The Expectation of σ<sup>2</sup> (0<E(σ<sup>2</sup>)≤10<sup>8</sup>)</font></body></html>",JLabel.CENTER);
JLabel label3 = new JLabel("<html><body><font size=3>The Variance of σ<sup>2</sup> (0<Var(σ<sup>2</sup>)≤10<sup>8</sup>)</font></body></html>",JLabel.CENTER);
JLabel label4 = new JLabel("<html><body><font size=3>The Ratio of σ<sup>2</sup> to Var(μ) (0<r≤10<sup>8</sup>)</font></body></html>",JLabel.CENTER);

public void init(){
label1.setPreferredSize(new Dimension(416,24));
label1.setFont(new Font("Serif",Font.BOLD,14));
add(label1);
label2.setPreferredSize(new Dimension(260,23));
label2.setFont(new Font("Serif",Font.BOLD,11));
add(label2);
yx.setPreferredSize(new Dimension(80,23));
add(yx);
label3.setPreferredSize(new Dimension(260,23));
label3.setFont(new Font("Serif",Font.BOLD,11));
add(label3);
yn.setPreferredSize(new Dimension(80,23));
add(yn);
label4.setPreferredSize(new Dimension(260,23));
label4.setFont(new Font("Serif",Font.BOLD,11));
add(label4);
yr.setPreferredSize(new Dimension(80,23));
add(yr);
yx.addActionListener(this);
yn.addActionListener(this);
yr.addActionListener(this);
}

public void actionPerformed(ActionEvent e){
if(e.getSource()==yx){
exp=Double.valueOf(yx.getText()).doubleValue();
if(exp <= 0 || exp > Math.pow(10.0,8)){
exp = 1.0;
}
}
if(e.getSource()==yn){
var = Double.valueOf(yn.getText()).doubleValue();
if(var <= 0 || var > Math.pow(10.0,8)){
var = 1.0;
}
}
if(e.getSource()==yr){m0 = Double.valueOf(yr.getText()).doubleValue();
if(m0 <= 0 || m0 > Math.pow(10.0,8))
{m0 = 3.0;}
}
yx.setText(""+exp);
yn.setText(""+var);
yr.setText(""+m0);
repaint();
}

public void paint(Graphics g){
    double n = 20;
    double n0 = 2*Math.pow(exp,2)/var+4;
    double s0 = 2*(Math.pow(exp,3)/var+exp)/n0;
    double u0 = 0;
    double q = 25.31;
    double ExpX = -0.18;
    double m1 = m0+n;
    double n1 = n0+n;
    double n1s1 = n0*s0+q+(m0*n/(m0+n))*(ExpX-u0)*(ExpX-u0);
    double u1 = (n*ExpX+m0*u0)/(m0+n);
s1[0]=1;
s2[0]=normal.sampleNormal(u1,(1/s1[0])/m1);
for(int i=0;i<9999;i++){
s1[i+1]=gamma.sampleGamma((n1+1)/2,1/(n1s1/2+m1*Math.pow(s2[i]-u1,2)/2));
s2[i+1]=normal.sampleNormal(u1,(1/s1[i+1])/m1);
}

d1[5000]=1/s1[5000];
d2[5000]=s2[5000];
for(int i=5001;i<10000;i++){
d1[i]=d1[i-1]+1/s1[i];
d2[i]=d2[i-1]+s2[i];
}
d3=d1[9999]/5000;
d4=d2[9999]/5000;

d5[4999]=0;
d6[4999]=0;

for(int i=5000;i<10000;i++){
d5[i]=Math.pow((1/s1[i]-d3),2)+d5[i-1];
d6[i]=Math.pow((s2[i]-d4),2)+d6[i-1];
}

d7=d5[9999]/(5000-1);
d8=d6[9999]/(5000-1);

// variable set
int[] xxxx = new int[1000];
int[] yyyy = new int[1000];
int[] xxxx1 = new int[1000];
int[] yyyy1 = new int[1000];
double minss1 = 1/s1[5000];
double maxss1 = 1/s1[5000];
double minss2 = s2[5000];
double maxss2 = s2[5000];

for(int i=5000;i<10000;i++){
if(1/s1[i]>maxss1){
maxss1 = 1/s1[i];
}
}

for(int i=5000;i<10000;i++){
if(1/s1[i]<minss1){
minss1 = 1/s1[i];
}
}

for(int i=5000;i<10000;i++){
if(s2[i]>maxss2){
maxss2 = s2[i];
}
}

for(int i=5000;i<10000;i++){
if(s2[i]<minss2){
minss2 = s2[i];
}
}
for(int i=0;i<1000;i++){
s3[i]=0;
s4[i]=0;
}

double aaa=(maxss1-minss1)/1000;
double bbb=(maxss2-minss2)/1000;
for(int i=5000;i<10000;i++){
for(int j=0;j<1000;j++){
if(1/s1[i] >= (minss1+aaa*j) && 1/s1[i] < minss1+aaa*(j+1))
s3[j]=(s3[j]+1.0);
}
}

for(int i=5000;i<10000;i++){
for(int j=0;j<1000;j++){
if(minss2+bbb*j<=s2[i] && s2[i]<minss2+bbb*(j+1))
s4[j]=s4[j]+1;
}
}

// variable set
double minss3 = s3[0];
double maxss3 = s3[0];
double minss4 = s4[0];
double maxss4 = s4[0];

for(int i=0;i<1000;i++){
if(maxss3<s3[i]){
maxss3 = s3[i];
}
}

for(int i=0;i<1000;i++){
if(s3[i]<minss3){
minss3 = s3[i];
}
}

for(int i=0;i<1000;i++){
if(s4[i]>maxss4){
maxss4 = s4[i];
}
}

for(int i=0;i<1000;i++){
if(s4[i]<minss4){
minss4 = s4[i];
}
}

double yyy = maxss3-minss3;
double yyy1 = maxss4-minss4;

for(int i=0;i<1000;i++){
xxxx[i] = (int)(i*351/1000)+33;
yyyy[i] = 474-(int)((s3[i]-minss3)*351/yyy);
xxxx1[i] = (int)(i*351/1000)+33;
yyyy1[i] = 474-(int)((s4[i]-minss4)*351/yyy1);
}

Graphics2D g2 = (Graphics2D)g;
GradientPaint gp1 = new GradientPaint(0, 0, new Color(154,181,228), 0,470,new Color(225,232,245), true);
g2.setPaint(gp1);
g2.fillRect(0,0,416,503);
super.paint(g);
GradientPaint gp2 = new GradientPaint(0, 33, new Color(225,232,245), 0,351,new Color(154,181,228), true);
g2.setPaint(gp2);
g2.fillRect(33,123,354,351);
GradientPaint gp3 = new GradientPaint(33, 227, new Color(79,129,189), 33,418,new Color(65,105,225), true);
g2.setPaint(gp3);
for (int i=0;i<1000;i++){
g2.drawLine(xxxx1[i], 474, xxxx1[i], yyyy1[i]);
}
GradientPaint(33, 227, new Color(192,88,77), 33,418,new Color(160,82,45), true);
g2.setPaint(gp4);
for (int i=0;i<1000;i++){
g2.drawLine(xxxx[i], 474, xxxx[i], yyyy[i]);
}
DecimalFormat df = new DecimalFormat("0.00");
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.setColor (new Color(0,0,0));
g2.drawString("n = 5000",280,157);
g2.setColor (new Color(0,0,0));
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("E(μ",280,177);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("*",300,176);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("|y) =",305,177);
g2.drawString(df.format(d4),335,177);
g2.drawString("Var(μ",280,197);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("*",312,196);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("|y) =",317,197);
g2.drawString(df.format(d8),347,197);
g2.setColor (new Color(0,0,0));
g2.drawString("E(σ",280,217);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("*",300,216);
g2.setFont(new Font ("Serif",Font.BOLD,8));
g2.drawString("2",305,212);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("|y) =",310,217);
g2.drawString(df.format(d3),340,217);
g2.drawString("Var(σ",280,237);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("*",312,236);
g2.setFont(new Font ("Serif",Font.BOLD,8));
g2.drawString("2",317,232);
g2.setFont(new Font ("Serif",Font.BOLD,12));
g2.drawString("|y) =",322,237);
g2.drawString(df.format(d7),352,237);
g2.drawString("E(y) = -0.18",280,257);
g2.drawString("Var(y) = 1.33",280,277);
g2.setColor (new Color(0,0,0));
g2.drawString("F",15,143);
g2.setColor (new Color(79,129,189));
g2.drawString("μ",345,488);
g2.setColor (new Color(0,0,0));
g2.drawString(",",353,488);
g2.setColor (new Color(192,88,77));
g2.drawString("σ",360,488);
g2.setFont(new Font ("Serif",Font.BOLD,8));
g2.drawString("2",371,483);
}
}

         source code: normal.java

import java.util.*;

public class normal {
private static Random rnd = new Random(Calendar.getInstance().
getTimeInMillis()+Thread.currentThread().getId());
private static double u;
public static double sampleNormal(double e0, double e1) {
double e2;
e2=Math.pow(e1,(0.5));
u=e2*rnd.nextGaussian()+e0;
return u;
}
}

            gamma.java

import java.util.*;

// See the below website, copy and paste the class "Samplers".
// Then modify the code as necessary.
//
// http://vyshemirsky.blogspot.com/2007/11/
// sample-from-gamma-distribution-in-java.html
//
// I express my appreciation for MY STRUGGLE.

In conclusion, the posterior distribution is roughly in such a position that the prior distribution moves from (μ, σ2) to (μ, σ2+0.5) because the posterior distribution is in proportion to the product of the conditional likelihood function and the prior distribution and the posterior distribution are the conjugate distributions. I also presume the assumption that I set the both expectation of σ2 and the variance of σ2 to small numbers reduces the value of both Var(μ*|y) and Var(σ*2|y).

Finally I am happy to assist you in coding and simulating a random process with the MCMC algorithm in JAVA.

 OpenSolarisでTexを利用するにはblastwave.org
を訪ねるのが手っ取り早いだろうと勝手ながら考え、
以前OpenPGPをインストールした時を思い出しながら
作業を進めることになったが、じっくり腰を据える姿勢
を忘れてはならないかなと自問自答する時がある。

 やってみなければ分からないことは数多いと思われる
が、JAVAのコーディングについてはひとまず区切りに
してもよいかなと、つまり形式的なバグだしは終了した
が、計算式を取り違えて書いておりそのために分散が
小さくなっている可能性を否定できないため、まあ
今後の課題が増えたとしか考えようがないかもしれない
状況だ。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
8/17。sordid, filthy, 汚い、specious, 見せ掛けだけの、
solicitous, 細心な、soporific, 眠気を催させる、
sophomoric, 未熟な、splenetic, 気難しい、stanch,
〜を止める、squander, 〜を浪費する、spurious,
偽の、等で失点しており、周回が必要か。

 独検対策は語彙と聞き取り。verschämt, 羞じた,
はじた、die Verschwendung, 奢侈, しゃし、
verschwinden, 呪詛する, じゅそする、verwickeln,
縺れる, もつれる、verzagen, 意気沮喪する, いき
そそうする、der Vorhang, 緞帳, どんちょう、等の
漢字の読み方を調べる必要があったことを追記する。

 明日もがんばろう。

 では。

調査続行、パート15。

| コメント(0) | トラックバック(0)

 サンプリングの結果を眺めてみると、本当に
この分散でいいのかと考え直すことが暫しなの
だが、試行錯誤は付きものだから、先に進むのみ
だろう。

 JAVAのコード自体もまだ人前に出せる水準では
なく、プロトタイプからの脱却が必要とされている
訳だが、出口に近づいていれば良しとしよう。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
5/20。scurvy, despicable, 卑しい、sap, 〜を弱める、
sanguine, 快活な、satire, 風刺、salutary, 健康回復に
よい、sanctimony, 信心家ぶること、satiate, overindulge,
十二分に満足する、seine, 引き網で取る、sanction, 認可、
sedulous, 勤勉に、shard, 破片、simper, にたにた笑う、
sinecure, 閑職、sere, 〜を萎びさせる、slake, (渇き等)
を満たす、等で失点しており、周回が必要か。

 独検対策は語彙と聞き取り。unverdrossen, 倦まない,
うまない、der Urlaub, 賜暇, しか、veranlassen, 惹起する,
じゃっきする、der Verband, 繃帯, ほうたい、verblühen,
凋む, しぼむ、等の漢字の読み方を調べる必要があり、
まだまだこれから。

 明日もがんばろう。

 では。

調査続行、パート14。

| コメント(0) | トラックバック(0)

 事後分布の3DをJAVAで2Dに落とし込むことまでは
出来ており、サンプリングの結果をどう表現し評価する
かまでが次の山に含まれるだろう。

 そう簡単に進まない話になりそうな気配もあるが、
高密度の散布図ならば評価に耐えうる表現に繋がる
かもしれないといった見通しを抱くときがある。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
4/27。remonstrate, 抗議する、redoubtable, 尊敬すべき、
refulgent, 燦然と輝く、repudiate, disown, 〜に関係が
ないと言う、recondite, 難解な、rent, 分裂、reconnoiter,
〜を予備調査する、refute, 〜の間違いを証明する、
regale, 〜を楽しませる、relegate, 格下げされる、
renege, (約束などを)破る、recumbent, 横になった、
recapitulate, 〜を要約する、repine, 〜を切望する、
redolent, 〜の匂いがする、reticent, 無口な、salient,
目立った、rescind, repeal, 〜を廃止する、sagacious,
聡明な、rue, remorse, 後悔、rubric, 規程、risible,
hilarious, 笑える、salacious, 好色な、等で失点して
おり、周回が必要だろう。

 独検対策は語彙と聞き取り。triefen, 滴る, したたる、
der Tropfen, 滴, しずく、der Trug, 詐り, いつわり、
überdrüssig, 倦んだ, うんだ、überragen, 〜の上に
聳える, そびえる、übertreten, 挫く, くじく、überziehen,
被う, おおう、der Umsturz, 顚覆, てんぷく、unabläßlich,
間断ない, かんだんない、等の漢字の読み方を調べる必要
があったことを追記する。

 明日もがんばろう。

 では。

調査続行、パート13。

| コメント(0) | トラックバック(0)

 事前分布を設定する際の簡単なシミュレーションを
行う段階まで進み始めたが、纏まった成果にするには、
まだまだ若干の時間を要する模様。

 今回に限ったことではないが、試行錯誤の連続の
ため、やはり予想外の時間が掛かることは仕方がない
とするしかないだろう。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
9/24。pusillanimous, 臆病な、qualify, 〜を限定する、
putrefy, 腐敗させる、quail, 怖じける、pugnacious,
喧嘩早い、pundit, 学者、qualms, reservation, 心配、
quaff, がぶ飲みする、rancorous, 憎い、quiescence,
静止、recant, retract, 撤回する、rail, 〜を罵る、
ramify, 枝状に分れる、recalcitrant, 反抗的な、rebus,
判じ物、等で失点しており、周回が必要か。

 仏検対策は語彙とディクテ。quand même, それでも、
sans quoi, さもなければ、les raisins secs, 干し葡萄、
à plus forte raison, 況や、par rapport à n, 〜に比べて、
faire table rase, 白紙状態に戻す、un avion à réaction,
ジェット機、en réalité, 実際には、une lettre
recommandée, 書留郵便、un rédacteur en chef, 編集長、
sans réserve, 遠慮なく、等を押さえる必要がある。

 次回の投稿は 9/16(木)です。

 では。

調査続行、パート12。

| コメント(0) | トラックバック(0)

 山が2つ程あり、そこを超えずしてその先の
展望に繋がらないのだが、その山が2つ以上ある
可能性を否定することもできず、まだまだこれ
から。

 調査のポイントは、ある段階で打ち切って
成果に繋げることができるかといったことを
考慮する段階にスムーズに移行することにある
かもしれないが、このペースを維持すれば、
大丈夫だろう。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
9/23。preen, groom, 身繕いする、prodigious, 巨大な、
prevaricate, 嘘をつく、predilection, 特別の好み、
prize, pry, 〜をこじ開ける、presumptuous, 生意気な、
prodigal, 〜を乱費する、prolix, long-winded, 諄い、
proscribe, outlaw, 〜を追放する、profligate, 乱費する、
profuse, 豊富な、propitious, 好意的な、propitiate,
〜の怒りを静める、等で失点しており、周回が必要か。

 仏検対策は語彙とディクテ。mettre qc en pièces,
〜をばらばらにする、Tant pis!, 仕方がない、en
plein, いっぱいに、en plein qc, 〜の真ん中に、pour
la plupart, 大抵、au poids, 量り売りで、une poignée
de qc, 少数の、être bien portant, 健康である、pour
son âge, 年の割に、pourvu que subj, 〜しさえすれば、
un parti au pouvoir, 与党、à peu près, ほとんど、等、
押さえる項目が多岐に亘る。

 明日もがんばろう。

 では。

 事前分布を求める際の正規分布と逆ガンマ分布の
積を3Dグラフで表現するところで結構戸惑ったが、
何とか見通しが立ちそうな雰囲気だ。

 ガンマ分布、延いてはガンマ関数自体、JAVAで
どうコーディングしているかについて更に調査が
必要な模様だが、まあ少し時間を掛けながら取り
組むつもり。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
7/11。plumb, 〜の深さを測る、poignant, 心に強く
訴える、prattle, 〜をぺちゃくちゃ喋る、precipitation,
〜を早める、等で失点しており、周回が必要か。

 仏検対策は語彙とディクテ。un livre d'occasion,
古本、un œuf dur, ゆで卵、un œuf à la coque, 半熟
卵、un œuf sur le plat, 目玉焼、à titre officiel, 公式
に、d'ordinaire, ふだんは、mettre qc en ordre, 〜を
整頓する、ou bien, あるいはまた, さもなければ、
un paire de ciseaux, はさみ一丁、un panier à
provisions, 買い物かご、tomber en panne, 故障する、
等、押さえる項目は多岐に亘る。

 明日もがんばろう。

 では。

調査続行、パート11。

| コメント(0) | トラックバック(0)

 JAVAを用いて3Dのグラフを2Dで表現するところ
まで落とし込んだが、細部に亘る詰めの作業が残って
おり、まだ一山ありそうだ。

 理論に対する理解もまだ浅い面があり、あと少し
時間が掛かるかもしれないと考えることはあるが、
このペースで構わないだろう。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
10/23。petulant, いらいらした、phlegmatic, sluggish,
鈍重な、pied, 多色の、picaresque, 悪漢小説、pervade,
permeate, 普及する、petrous, 岩の様な、philistine,
俗物、plethora, 過多の、pithy, 簡潔な、pith, 核心、
pique, 憤り、pluck, 勇気、等で失点しており、周回が
必要か。

 独検対策は語彙と聞き取り。der Strauch, 簇生小木,
そうせいしょうぼく、der Strich, 一刷毛, ひとはけ、
das Tau, 索, なわ、der Teig, 捏粉, ねつふん、等の
漢字の読み方を調べる必要があり、まだまだこれから。

 明日もがんばろう。

 では。

のんびりと、パート38。

| コメント(0) | トラックバック(0)

 年がら年中のんびりしているんじゃないかと
お叱りを受けそうな気配もあるが、やることを
しっかりやっての事だから、妥当な経過に含ま
れるだろう。

 調査もこれから応用範囲を定める段階に移行
しつつあり、それでもコーディングに若干課題
が残る面を考慮すると、やはり少し時間が掛かる
かもしれない。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
11/20。第2回を見送る予定で、第3回をどうするかに
ついてはエッセイの改善次第といったあたりに落ち
着くことだろう。

 独検対策は語彙と聞き取り。今年、つまり秋期は
英検と同じく見送りで、勝負は来年以降のことになる
予定。まだまだやることは沢山あるかな。

 明日もがんばろう。

 では。

着々と、パート3。

| コメント(0) | トラックバック(0)

 幾つか調査を進めており、いつもの様にある程度
纏まった段階でなにがしか報告できることがあるか
と思われるが、それは少し先の話になるかもしれない。

 まあ現段階では然程ゆとりを必要としていない
のだが、これから少し忙しくなるかもしれず、今後
の展開に依存する面は少なくないだろう。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
8/21。ostentatious, pretentious, 派手な, 大袈裟な、
officious, meddlesome, お節介な、ostensible,
見せ掛けの、occult, 秘密の、occlude, obstruct,
〜を塞ぐ、obviate, anticipate, 〜(の必要性)を
取り除く、〜を未然に防ぐ、opaque, dense,
愚鈍な、onerous, 厄介な、panegyric, 賞賛の言葉、
paragon, 模範、pariah, outcast, のけ者、等で失点
しており周回が必要か。

 独検対策は語彙と聞き取り。das Schlamm,
泥濘, ぬかるみ、der Schleier, 面紗, めんしゃ、
die Schleppe, 曳裾, ちょうきょ、schlürfen,
啜る, すする、schroff, 嶮峻な, けんしゅんな、
der Schütz, 射手, しゃしゅ、der Schweif, 引裾,
いんきょ、等の漢字の読み方を調べる必要が
あった。

 明日もがんばろう。

 では。

のんびりと、パート37。

| コメント(0) | トラックバック(0)

 色々と試してみたいことが出始めたため、その
準備を進めている。以前出来なかったことが、現
段階で出来る様になっていると心強いのだが、そう
簡単にはいかないだろうとの見通しを抱いている。

 sol-10-u7は約100〜200KB/secだったが、sol-10
-u8になると約500KB/sec出ており、Oracleが何に
力点を置いているのか、分かり易い経過となる。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
14/23。obsequious, こびる、nonplussed, baffled,
当惑させる、obtain, (慣習・法律などが)通用する、
obeisance, 敬礼、obtuse, 鈍感な、obstreperous,
boisterous, 騒がしい、obdurate, 強情な、obfuscate,
〜を混乱させる、等で失点しており、周回が必要か。

 仏検対策は語彙とディクテ。par manque de qc,
〜がないので、une table des matières, 目次、faire
la grasse matinée, 朝寝坊する、un poêle à mazout,
石油ストーブ、mener à bien, うまく成し遂げる、
au mépris de qc, 〜を物ともせず、sans mesure,
過度に、faute de mieux, やむなく、une mise en
vente, 競売、等を押さえる必要がある。

 次回の投稿は9/9(木)です。

 では。

着々と、パート2。

| コメント(0) | トラックバック(0)

 b6が開発されている中、Minefield4.0をbeta3から
beta5に移行し、最先端とは言い難いものの、Syncの
標準装備を試してみることから見られる様にその恩恵
を意外なところで受ける形となる。

 年がら年中こんなことをやっている訳にはいかないが、
今年前半を棒に振った分、ここで若干取り戻しておくこと
はそう悪い話ではないだろうと考える次第。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
8/22。mellifluous, 甘美な、mercurial, 移り気な、
martinet, (通例けなして)厳格な人、maunder, ふら
ふら歩き回る、mollify, 〜を宥める、mince, 〜を気
取って話す、mettlesome, 元気のいい、militate,
〜に不利に作用する、milk, 〜から搾り取る、minatory,
威嚇的な、等で失点しており、周回が必要か。

 仏検対策は語彙とディクテ。à l'insu de qn, 〜の
知らぬ間に、à l’inverse, あべこべに、à l'issue de qc,
〜が終わったとき、jusqu'à ce que subj, 〜するまで、
de long en large, 縦横に、au large, 手広く、être
libre de inf, 自由に〜できる、au lieu de n (inf),
〜の代わりに、avoir lieu, 行われる、等を押さえる
必要がある。

 明日もがんばろう。

 では。

 結構我慢した方だと思うが、やっぱり合わないものは
合わないわけだから、日々の言動に制約を加えることを
止めにする算段。地方の文化を尊重すると言えば聞こえ
はいいが、内情地方のドロドロした文化を持ち込まれる
のは必至な訳で、線引きしても良い頃だろうと考えている。

 決して地方を軽視している訳ではないが、地方特有の
価値観を示されても共感できる部分が少ないことは理解
してもらえるだろう。理解はするが共感しないといったスタ
ンスを維持するのも結構大変なことだ。だから自由にさせ
てもらう。具体的に言えば(これは言わない方が我が身の
ためなのだが)、地方のおちょくり文化は肌に合わない。

 これまた一言加えると火に油を注ぐ結果となりそうだが、
世の中には色んな人がおり、別に他人を貶めなくても日々
を楽しく過ごすことができるユーモアをもった人は数多く
存在し、僕自身も風刺やおちょくりと一線を画しながら日々
を謳歌することができる部類に属すると考えているため、
まあ勝手にさせてもらうことにする。「お前、何者だよ?」と
言われる向きには、「お前らと同じ世界で生きている唯の
一般人だが、お前とは違う」と答えることにする。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
15/24。lassitude, listlessness, 物憂さ、jibe, 〜と
一致する、lucid, わかりやすい、malleable, pliable,
柔順な、list, 傾くこと、malinger, 仮病を使う、limpid,
明快な、limn, 〜を描く、lumber, 〜をがらくたで一杯
にする、等で失点しており、周回が必要か。

 仏検対策は語彙とディクテ。有音のhで始まる語と
して、un hasard, 偶然、une hausse, 上昇、un héros,
主人公、une honte, 不名誉、hors de qc, 〜のほかに、
un hors-d'œuvre, オードブル、等があり、再度押さえる
必要があるだろう。

 明日もがんばろう。

 では。

漸く設定が終わったか。

| コメント(0) | トラックバック(0)

 大したことはしていないのだが、意外に手間取り
週末までずれ込んでしまったようだ。年に数回あるか
ないかのためにここまでやる必要はないかもしれない
が、一応の備えとしては妥当だろうか。

 同時に脈絡のない論理展開だが、秋とは言えまだ
まだ暑く、10〜11月まで涼しさを待ったほうが良い気配を
感じているせいだろうか、次にやることとして最近の駅での
待ち時間の蒸し暑さを避ける方策としての涼み処の開拓
(ちょっとした木陰でも風が吹いていれば救われる)が必要
とされているのかもしれない。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
5/22。iniquity, wickedness, 邪悪、inimitable, 独特な、
inimical, 有害な、innocuous, 無害な、insular, 狭量な、
inveigh, 〜を痛烈に非難する、intransigent, 妥協しない、
inveterate, ingrained, 根深い、inveigle, だまし取る、
intimate, insinuate, 仄めかす、inundate, 充満する、
inured, 慣れる、interdict, 〜を禁ずる、intrepid, 恐れを
知らない、invidious, 他人の妬みを買うような、
intractable, 強情な、等で失点しており、周回が必要か。

 独検対策は語彙と聞き取り。die Rübe, 蕪, かぶ、
die Rute, 笞, むち、das Sacrament, 秘蹟, ひせき、
die Sammlung, 蒐集, しゅうしゅう、die Schale, 莢,
さや、die Schanze, 堡塁, ほうるい、der Schauer,
驟雨, にわかあめ、der Schelm, 剽軽者, ひょうけい
しゃ、der Schenkel, 腿, もも、der Schimpf, 罵詈,
ばり、等の漢字の読みで苦労する。

 明日もがんばろう。

 では。

 まだ全てを話しきった訳ではないが、以前の勉強系
ブログに戻ることにする。よく日記と勘違いされることが
あるが、やることが残っているので、暫くはこんな感じで
進むことになろうか。

 それで話しきっていないこととは、現段階で調査中の
ことが幾つかある事情を鑑み、まあある程度纏まった段階
で、散発的に公開することになるかと考えているが、要は
いつもと変わることがないといった結論に落ち着くことに
なるだろう。

 ここからが今日の課題。

 英検対策は語彙とエッセイ。WSGREの正答率は、
9/20。importune, 〜にうるさくせがむ、impugn, 〜を
非難する、impute, ascribe, 〜のせいにする、imper-
turbable, 冷静な、imprudent, impertinent, 生意気な、
inert, 自力で運動できない、inchoate, unformed,
未完成の、indefatigable, 疲れを知らない、ineluctable,
避けられない、等で失点しており、周回が必要だろう。

 独検対策は語彙と聞き取り。der Dozent, 講師、
der Purpur, 紫衣, しえ, 緋衣, ひえ、puzten, 上塗する,
うわぬりする、der Qualm, 濃烟, のうえん(だと思うが
詳細を確認しきっていない)、quetschen, 搗く, つく、
räumen, 除ける, のける、das Reis, 若枝, わかえだ、
等の語句及び漢字を調べる必要があった。

 明日もがんばろう。

 では。

My Photo
プロフィール!
2016・11・15 改訂
spacer01
rssspacer01foaf
spacer01
atom.xml
spacer01

このアーカイブ

このページには、September 2010に書かれた記事が新しい順に公開されています。

前のアーカイブはAugust 2010です。

次のアーカイブはOctober 2010です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。

August 2023

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Recent Comments

月別 アーカイブ

Workbooks

  • Basic Word List
  • Basic Word List 3rd Edition
  • Samuel C. Brownstein (著), Mitchel Weiner (著), Sharon Weiner Green (著)
  • SAT、GRE用の語彙が2000語以上収録され、2009年4月に4th Editionが出版される。又、Synonym Testが750題、Comprehensive Testが75題付記されている。2005年8月に国内向けの訳本として『最強の英語ボキャブラリー1700語』が出版され、Synonym Testが500題、Comprehensive Testが50題付記されている。
  • 1100 Words You Need to Know
  • 1100 Words You Need to Know 4th Edition
  • Murray Bromberg (著), Melvin Gordon (著)
  • SAT用の語彙が920語、熟語が184語収録され、2008年6月に5th Editionが出版される。Review, 24題で1週分の知識の確認を、Analogy Review, 15~20題で10週分の確認を、Final Review Test, 150題で46週分の確認を行うことになる。1周しただけで定着する程簡単なものではなく、繰り返しが重要なことは他のボキャビル本と同様。音声教材として Wordplay: 550+ Words You Need to Know 2nd Edition が出されており、The Rambling Panthersから始まる7つのドラマに新出語句を散りばめている。
  • Kaplan Word Power
  • Kaplan Word Power 3rd Edition
  • Kaplan (著)
  • SAT、GRE用の語彙が750語収録され、Plug Inの10~15題で1課分の知識の確認を行うことになる。収録語彙の水準は類書よりやや高めで、Plug Inでの設問の尋ね方もやや高度なものになっている。具体的には Fill in the blanks. や Match the word closest to the word that means the opposite. といった形式に苦労した。又、音声教材として Kaplan Word Power (CD) があり、CD2枚の構成になっている。
  • Word Smart
  • Word Smart for the GRE, 2nd Edition
  • Princeton Review (著)
  • GRE用の語彙が678語収録され、Quick Quizは65課あり、6~15題で1課分の知識の確認を、Final Exam Drillの570題で57課分の確認を行うことになる。類書にSAT用のWord Smart、Word Smart Ⅱ等があり、それらを含めて繰り返し訓練するとなると、結構時間が掛かるのは当然だろう。又、音声教材としてSAT用だが The Princeton Review Word Smart CD があり、All or Nothingから始まる14のドラマに228語が散りばめられている。
spacer01

Banner


Bookmark

  • Valid XHTML 1.0 Transitionalspacer01
  • Valid CSS!spacer01
OpenID 対応しています OpenIDについて