Most DGE models include a number of core of elements:
Households represent the demand side of the economy. We need to specify their preferences over commodities and endowments. We also need to state the households’ objective, which usually is utility maximization. That is households try to maximize their preferences subject to a set of constraints.
Beside households, we need to specify the supply side. We specify an amount of firms and a technology that firms can use to produce and sell goods. Furthermore, we also need to define the goal of firms. Usually, the objective of firms consists in maximizing their profits subject to their production plans being technologically feasible.
Additionally, we need to specify institutions, which usually includes a government and/or a central bank. Particularly, we need to specify the policy of the institutions. Thereby, the policy of institutions can be taken as given or being modelled as optimally chosen, subject to a government budget constraint.
It is important to specify the information in the economy. That is, we need to specify who knows what at which point in time.
We need to implement markets and think of what kind of market we wish to model. Popular choices of markets include ArrowDebreu, Sequential Markets and Incomplete Markets.
Finally, we need to specify the equilibrium concept. A possible choice is the competitive equilibrium, in which the price cannot be influenced by a single firm.
cluster(variable_name)
to your regression, where variable_name specifies the variable that defines the group / cluster in your data. The summary output will return clustered standard errors. Here is the syntax:
regress x y, cluster(variable_name)
Below you will find a tutorial that demonstrates how to calculate clustered standard errors in STATA. The tutorial is based on an simulated data that I generate here and which you can download here.
* start with an empty workspace clear all *import data into your STATA session import excel using "https://economictheoryblog.files.wordpress.com/2016/12/data.xls",first *OLS without clustered standard errors regress id_score class_size *OLS with clustered standard errors regress id_score class_size, cluster(class_id) * Note, the standard errors are much * larger with clustered standard errors
The official website describes Julia as
“a highlevel, highperformance dynamic programming language for numerical computing. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library. Julia’s Base library, largely written in Julia itself, also integrates mature, bestofbreed open source C and Fortran libraries for linear algebra, random number generation, signal processing, and string processing. In addition, the Julia developer community is contributing a number of external packages through Julia’s builtin package manager at a rapid pace.”
Julia incorporates various key advantages of other languages. First, Julia reaches the speed of compiled languages such as C++ and Fortran. Furthermore, Julia provides the dynamism of highlevel languages, such as Ruby or Python as well as the mathematical notations of MATLAB or Octave. Last but not least, Julia provides the statistical ease of R and the general usage of Python. Combing these elements makes Julia an incredible powerful language.
First, Julia is a multiple dispatch language. That is, in a multiple dispatch language, a function call may dispatch to different functions depending on the type called at runtime, which stands in contrast to a single dispatch language, in which a function call always sends to the same function. A multiple dispatch environment ensures that, depending on the variables provided to the function, different results will be produced.
A additional feature of Julia is speed. Julia complies codes on the fly, reaching an incredible velocity. Julia combines the method of interpreting languages, such as Python, that transform the code into bytecode on the fly, with compiled languages (C/Fortran), that compile their code into machine code and then running the resulted executable. This approach allows Julia to produce similar speeds to C, while having a code similar to Python or MATLAB.
Similar to R, Packages are an important feature of Julia. Due to its builtin package manager, it already has over 1500 registered packages (and the number keeps growing). Julia also provides the possibility to resort to C, Fortran and Python packages, making it easy to run existing code. Finally, Julias compiler ability encourages the community to continues to develop packages in pure Julia.
The most amazing feature of Julia is its parallelism. In Julia, one can parallelize directly from command line by calling the desired script with a given number of cores. Additionally, it is possible to send tasks to different threads directly from code. Lastly, Julia can run loops in parallel directly. That is, one does not need to designating different threads to each loop.
While Julia offers awesome features, it also comes with some pitfalls. First, Julia hashes its dictionaries differently to Python, which currently can prove slower. Second, while not necessary a disadvantage, in Julia Language arrays are 1indexed, along with Fortran array ordering. Thus, depending on the code one uses, it might not be out of the box compatible with Python or C. Furthermore, although it has quite a incredible parallelisation, it is still often not fast enough, and might even slow down execution. Lastly, Julia is still in beta (currently v0.6). Hence, it is not ensured that future versions of Julia are backwards compatible, possible rendering present code obsolete in the future.
Overall, Julia was created to overcome the programming time vs runtime problem. It has several advantages, including speed, familiarity to Python, R and C, multiple dispatch environment, parallelism, a large amount of packages, and the possibility to incorporate other languages. Nevertheless, Julia also comes with some drawbacks, such as still being in beta, indexing and hashing.
At this point I should once again warn you that using root access can ruin your whole system. Don’t use it if you don’t know what you are doing!
One can get GUI root login on KDE5 Plasma running sddm as follows:
1) set the root password “sudo passwd root”
2) in /etc/sddm.conf change MinimumUid=1000 to MinimumUid=0
3) in /etc/pam.d/sddm comment out “auth required pam_success_if.so user != root quiet_success”
4) Reboot into the glory of root access! Don’t bjork your machine now!
I hope this helps!
What are the commands for the most important mathematical operations in Julia and R? The following table translates the most common Julia commands into R language.
Julia  R  

Dot product  
dot(a,b) 
a%*%b 

Matrix multiplication  
A * B 
A%*%B 

Elementwise multiplication  
A .* B 
A * B 

Matrix to a power 

A^2 
require(exem) A%^%2 

Matrix to a power, elementwise 

A.^2 
A^2 

Inverse 

inv(A) 
solve(A) 

Determinant 

det(A) 
det(A) 

Eigenvalues and eigenvectors 

eig(A) 
eigen(A) 

Euclidean norm 

norm(A) 
norm(A, type="2") 

Solve least squares problem Ax = b 

A\b 
solve(a,b) 
Complete JuliaR Cheatsheet
1) Creating Vectors
2) Creating Matrices
3) Creating Random Numbers
4) Manipulating Vectors and Matrices
5) Accessing Vector/Matrix Elements
How to access vector and matrix elements in Julia and R? The following table translates the most common Julia commands into R language.
Julia  R  

Access one element  
A[2, 2] 
A[2, 2] 

Access specific rows  
A[1:4, :] 
A[1:4,] 

Access specific columns  
A[:, 1:4] 
A[,1:4] 

Concatenate vertically 

A = [[1 2]; [1 2]] 
A = rbind(c(1,2),c(1,2)) 

Remove a row 

A[[1, 2, 4], ] 
A[3, ] 

Diagonals of matrix 

diag(A) 
diag(A) 

Get dimensions of matrix 

size(A) 
dim(A) 
Complete JuliaR Cheatsheet
1) Creating Vectors
2) Creating Matrices
3) Creating Random Numbers
4) Manipulating Vectors and Matrices
5) Accessing Vector/Matrix Elements
How to manipulate vectors and matrices in Julia and R? The following table translates the most common Julia commands into R language.
Julia  R  

Transpose  
A.' 
t(A) 

Complex conjugate transpose  
A ' 
Conj(t(A)) 

Concatenate horizontally  
A = [[1 2] [1 2]] 
A = c(c(1,2),c(1,2)) 

Concatenate vertically 

A = [[1 2]; [1 2]] 
A = rbind(c(1,2),c(1,2)) 

Reshape (to 5 rows, 2 columns) 

A = reshape(1:10, 5, 2) 
A = matrix(1:10,5,2) 

Convert matrix to vector 

A[:] 
c(A) 

Repeat matrix (3 times in the row dimension, 4 times in the column dimension) 

repmat(A,3,4) 
kronecker(matrix(1,3,4),A) 

Flip Matrix form left to right 

flipdim(A, 2) 
A[,dim(A)[2]:1] 

Flip Matrix up/down 

flipdim(A, 2) 
A[dim(A)[1]:1,] 
Complete JuliaR Cheatsheet
1) Creating Vectors
2) Creating Matrices
3) Creating Random Numbers
4) Manipulating Vectors and Matrices
5) Accessing Vector/Matrix Elements
How to create random number in Julia and R? The following table translates the most common Julia commands into R language.
Julia  R  

Create uniform random numbers 

A = rand(10) 
A = runif(10) 

Create normal random numbers  
A = randn(10) 
A = rnorm(10) 

Create normal random numbers (mean=1,std=2) 

using Distributions A = rand(Normal(1,2),10) 
A = rnorm(10,1,2) 

Create Gamma distributed random numbers (shape=1,scale=2) 

using Distributions A = rand(Gamma(1,2),10) 
A = rgamma(10, shape = 1, scale = 2) 

Create Beta distributed random numbers (alpha=1,beta=2) 

using Distributions A = rand(Beta(1,2),10) 
A = rbeta(10,1,2) 
Complete JuliaR Cheatsheet
1) Creating Vectors
2) Creating Matrices
3) Creating Random Numbers
4) Manipulating Vectors and Matrices
5) Accessing Vector/Matrix Elements
How to create matrices in Julia and R? The following table translates the most common Julia commands into R language.
Julia  R  

Create a matrix  
A = [1 2; 3 4] 
A = matrix(c(1,2,3,4),2,2) 

Create a 2 x 2 matrix of zeros  
A = zeros(2,2) 
A = matrix(0,2,2) 

Create a 2 x 2 matrix of ones  
A = ones(2,2) 
A = matrix(1,2,2) 

Create a 2 x 2 identity matrix 

A = eye(2,2) 
A = diag(2) 

Create a diagonal matrix 

A = diagm([1;2;3;]) 
A = diag(c(1,2,3)) 
Complete JuliaR Cheatsheet
1) Creating Vectors
2) Creating Matrices
3) Creating Random Numbers
4) Manipulating Vectors and Matrices
5) Accessing Vector/Matrix Elements
How to create vectors in Julia and R? The following table translates the most common Julia commands into R language.
Julia  R  

Create a row vector  
A = [1 2 3] 
A = c(1,2,3) 

Create a column vector  
A = [1 2 3]' 
A = matrix(c(1,2,3),3,1) 

Create integers from j to n with step size k  
A = j:k:n 
A = seq(j,n,k) 

Create linearly spaced vector of k points  
A = linspace(1, 5, k) 
A = seq(0, 1, length.out = 10) 
Complete JuliaR Cheatsheet
1) Creating Vectors
2) Creating Matrices
3) Creating Random Numbers
4) Manipulating Vectors and Matrices
5) Accessing Vector/Matrix Elements