JAVA fundamental5

Queue (after stack)

file

import java.util.LinkedList;
import java.util.Queue;

public class Main {
    public static void main(String[] args) {
        //add()和remove()方法在失败的时候会抛出异常(不推荐)
        Queue<String> queue = new LinkedList<String>();
        //添加元素
        queue.offer("a")[......]

Read more

JAVA fundamental4

final

We can use final to declare an object, func, var

  • object: When declare with final, this object can’t be Inherited.
    file

static

When a func/var is clared as static, it will always occupy the original memeoy. Whenever we new some objects, the same static func/variable in these objects are always t[……]

Read more

Sort Algorithm

file

1. Buble Sort

//Buble Sort
   public static int[] bubbleSort(int[] array) {
        if (array.length == 0)
            return array;
        for (int i = 0; i < array.length; i++)
            for (int j = 0; j < array.length - 1 - i; j++)
                if (array[j + 1] < array[j]) {[......]

Read more

Applied Statistical Methods-1

file

  • Gauss-Markov Theorem
    https://iewaij.github.io/introDataScience/GaussMarkov.html

    为了证明 OLS 估计无偏,我们需要假设 1: E(ϵ)=0 ;假设 2: X 为确定值。

    为了得到 OLS 估计的协方差矩阵和证明 OLS 估计是最佳无偏线性估计,我们需要假设 3.1: ∀i≠j,(ϵ_i)与(ϵ_j)独立, (Cov(ϵ_i,ϵ_j) = 0 );假设 3.2: (Var(ϵ_1)=Var(ϵ_2)…=Var(ϵ_i)=σ^2 )。这两个假设可以合并为假设 3: (Var(ϵ)=σ^2I) 。

    注意,证[……]

    Read more

JAVA fundamental3

An example for what have mentioned in last note.

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Input Principle: ");
        long p = scanner.nextLong();
        System.out.print("Input Annua[......]

Read more