Skip to content

Commit

Permalink
working with tests and 1.9 CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Gkreindler committed Dec 29, 2023
1 parent f4a6361 commit 31bbba8
Show file tree
Hide file tree
Showing 6 changed files with 710 additions and 719 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.7'
- '1.9'
- 'nightly'
os:
- ubuntu-latest
Expand Down
19 changes: 4 additions & 15 deletions examples/example_errors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using Random

# Run plain OLS for comparison
reg_ols = reg(df, term(:mpg) ~ term(:acceleration))
regtable(reg_ols)
RegressionTables.regtable(reg_ols)

# define moments for OLS regression
# residuals orthogonal to the constant and to the variable (acceleration)
Expand All @@ -35,7 +35,7 @@ end

# initial parameter guess
Random.seed!(123)
theta0 = random_initial_conditions([10.0, 0.0], 20)
theta0 = GMMTools.random_initial_conditions([10.0, 0.0], 20)

### using Optim.jl
# estimation options
Expand Down Expand Up @@ -89,20 +89,9 @@ end
myfit.vcov.boot_fits
myfit.vcov.boot_fits.boot_fits_df

regtable(myfit) # print table with new bootstrap SEs -- very similar to asymptotic SEs in this case. Nice!
GMMTools.regtable(myfit) # print table with new bootstrap SEs -- very similar to asymptotic SEs in this case. Nice!

dsfsdf
# read vcov with bootstrop from file
myfit.vcov = GMMTools.read_vcov(myopts)
regtable(myfit) |> display

# using Plots
# histogram(myfit.vcov[:boot_fits].all_theta_hat[:, 1])

# bootstrap with weightes drawn at the level of clusters defined by the variable df.cylinders
# myopts.trace = 0
# vcov_bboot(df, ols_moments_fn, theta0, myfit, boot_weights=:cluster, cluster_var=:cylinders, nboot=500, opts=myopts)
# myfit.vcov

# GMMTools.regtable(myfit)
GMMTools.regtable(myfit) |> display

Loading

0 comments on commit 31bbba8

Please sign in to comment.