Skip to content

Commit 72d8de8

Browse files
author
DW
committed
6th commit
1 parent 999d57b commit 72d8de8

File tree

6 files changed

+31
-78
lines changed

6 files changed

+31
-78
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Dazhong Wu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1919
MomentaPlotsExt = "Plots"
2020

2121
[compat]
22+
julia = "1.9"
2223
BenchmarkTools = "1.6.3"
2324
CSV = "0.10.15"
2425
DataFrames = "1.7.0"
2526
Distributions = "0.25.117"
26-
LinearAlgebra = "1.11.0"
27+
LinearAlgebra = "1"
2728
Plots = "1.41.2"
2829
PrecompileTools = "1.3.3"
2930
PrettyTables = "2.4.0"
30-
Random = "1.11.0"
31+
Random = "1"
3132

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ df = CSV.read("dahlberg_data.csv", DataFrame)
8282
m = Momenta.fit(df,
8383
["id", "year"],
8484
"n w ~ lag(n, 1:2) lag(w, 1:2) k",
85-
"GMM(n w ,2:4) IV(k)",
85+
"GMM(n w, 2:4) IV(k)",
8686
"fod"
8787
)
8888

src/Momenta.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ end
4444

4545
function fit(
4646
df::DataFrame,
47-
id_time::Vector{String},
47+
panel_ids::Vector{String},
4848
model_str::String,
4949
instr_str::String, opts::String="", silent::Bool=false
5050
)
51+
52+
id_time = string.(panel_ids)
5153
# 1. Extract ID and Time
5254
# === 1. Parameter validation (this must be supplemented) ===
5355
if length(id_time) != 2

test.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ df <- fread("data.csv")
44

55
start_time <- Sys.time()
66
p1 <- pvargmm(
7-
dependent_vars = c("n", "w", "k"),
7+
dependent_vars = c("n", "w"),
88
lags = 2,
99
#predet_vars = c("w","k"),
10-
#exog_vars=c("revenues"),
10+
exog_vars=c("k"),
1111
transformation = "fod",
1212
data = df,
1313
panel_identifier = c("id", "year"),
1414
steps = c("twostep"),
15-
system_instruments =FALSE, #TRUE, #FALSE, #TRUE,
15+
system_instruments = TRUE, #TRUE, #FALSE, #TRUE,
1616
system_constant = TRUE,
1717
max_instr_dependent_vars = 4,
1818
min_instr_dependent_vars = 2,

test.jl

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)