This post is aimed at collecting the visualization Resources so as to assist illustrating the data features and research results
Understanding Convolutional Neural Network
Convolutional Neural Network 由两部分组成:convolution 和 neural network。想要深入了解CNN,我们首先需要了解什么事convolution,以及如何将convolution引入到neural network中。
Practical Problems in Applied Econometrics
This post summarize some practical problems in applied econmetrics
- Incidental parameter problem
Understanding Decorator in Python
Decorator in Python
Many times when you read the code, you will find some annoying synax like @somefunction
. What does that mean? That is the decorator in python. The synax for the decorator has the following definition and function:
1 | @decorator |
the main advantage is that you can use the decorator as a standardized way to create variables that have the same behaviour, instead
of havng to do that using methods. I think that a lot can be gained by specifying a decorator that can decorate variables or properties.
BUT, just look at the synax again, the decorator actually help developer to initialize the variable before the invoke of the function. for example:
1 | list_function=[] |
if we check the list_function
, we will find
1 | >>>list_function |
In order to have a deeper understanding of the decorator, remember that functions are objects in Python.
1 | def shout(word="yes"): |
Another interesting property of Python functions is they can be defined… inside another function!
1 |
|
Usually, people use decorator to define a insider functions for invoke. The following is the example without decorator1
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
32
33
34
35
36
37
38
39
40
41
42
43
# A decorator is a function that expects ANOTHER function as parameter
def my_shiny_new_decorator(a_function_to_decorate):
# Inside, the decorator defines a function on the fly: the wrapper.
# This function is going to be wrapped around the original function
# so it can execute code before and after it.
def the_wrapper_around_the_original_function():
# Put here the code you want to be executed BEFORE the original
# function is called
print "Before the function runs"
# Call the function here (using parentheses)
a_function_to_decorate()
# Put here the code you want to be executed AFTER the original
# function is called
print "After the function runs"
# At this point, "a_function_to_decorate" HAS NEVER BEEN EXECUTED.
# We return the wrapper function we have just created.
# The wrapper contains the function and the code to execute before
# and after. It's ready to use!
return the_wrapper_around_the_original_function
# Now imagine you create a function you don't want to ever touch again.
def a_stand_alone_function():
print "I am a stand alone function, don't you dare modify me"
a_stand_alone_function()
#outputs: I am a stand alone function, don't you dare modify me
# Well, you can decorate it to extend its behavior.
# Just pass it to the decorator, it will wrap it dynamically in
# any code you want and return you a new function ready to be used:
a_stand_alone_function_decorated = my_shiny_new_decorator(a_stand_alone_function)
a_stand_alone_function_decorated()
#outputs:
#Before the function runs
#I am a stand alone function, don't you dare modify me
#After the function runs
When we start using decorator, the world becomes simple:
1 | @my_shiny_new_decorator |
How to Use Pandoc
About pandoc
If you need to convert files from one markup format into another, pandoc is your swiss-army knife. Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, TWiki markup, OPML, Emacs Org-Mode, Txt2Tags, Microsoft Word docx, LibreOffice ODT, EPUB, or Haddock markup to
- HTML formats: XHTML, HTML5, and HTML slide shows using Slidy, reveal.js, Slideous, S5, or DZSlides.
- Word processor formats: Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML
- Ebooks: EPUB version 2 or 3, FictionBook2
- Documentation formats: DocBook, TEI Simple, GNU TexInfo, Groff man pages, Haddock markup
- Page layout formats: InDesign ICML
- Outline formats: OPML
- TeX formats: LaTeX, ConTeXt, LaTeX Beamer slides
- PDF via LaTeX
- Lightweight markup formats: Markdown (including CommonMark), reStructuredText, AsciiDoc, MediaWiki markup, DokuWiki markup, Emacs Org-Mode, Textile
- Custom formats: custom writers can be written in lua.
installing
you can install pandoc from its website
geting started
for example, if you want to convert latex file (demo.tex )into md, then you can :
- change path into the file directory
- use the command
pandoc demo.tex -f latex -t markdown -s -o demo.md
convert latex to markdown - use the commond
pandoc demo.md -f markdown -t html -s -o demo.html
convert markdown to html
pretty simple right ?!
for more information, you can see from http://pandoc.org
US Airline Flight Route Map
In this post, I try to summarize the the construction of US Airline Flight Map. The data source comes from Bureau of Transportation Statistics. The first thing is to obtain the local airport information. For example, the GIS location, the carrier’s market share and market construction, and the distance from the near HUB. Secondly, I want to draw the flight route map.
Typora for Math Formula
How to number the equations
As far as I can see, in mac system, Typora automatically number the equations in Math block . But in windows system, there is no automatically numbering function. whether it has automatically or not, we can always choose to use \tag{}
and \nonumber
to number or remove the number for certain equations.
How to cite the equations
If we want to cite the equations later, we can use \label{name}
and \ref{label_name}
to cite the particular equation. Of course, we need to add $ $
outsides.
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Economics Important Data and Tools
This script lists some importance data source and tools for economic research and study
Mechanism Design and Contract Theory Introduction
Mechanism Design
Mechanism design is a field in economics and game theory that takes an engineering approach to designing economic mechanisms or incentives, toward desired objectives, in strategic settings, where players act rationally.
Participants in the Mechanism design understand that they are playing a non-cooperative game. Game theory takes the rules of the game as given. The theory of mechanism design is about the optimal choice of the rules of the game
Because it starts at the end of the game, then goes backwards, it is also called reverse game theory. Mechanism design studies solution concepts for a class of private-information games.
Mechanism design theory provides a coherent framework for analyzing this great variety of institutions, or allocation mechanisms, with a focus on the problems associated with incentives and private information. By using game theory, mechanism design can go beyond the classical approach, and, for example, explicitly model how prices are set. The theory shows, for example, that so-called double auctions (where buyers and sellers post their bid- and ask-prices) can be efficient trading institutions when each trader has private information about his or her valuations of the goods traded.