Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I run “sc = Synth(data,……n_optim=100)”, I get the error "ValueError: 'x0' must only have one dimension." #27

Open
PG408 opened this issue Oct 27, 2024 · 1 comment

Comments

@PG408
Copy link

PG408 commented Oct 27, 2024

run code below , get the error "ValueError: 'x0' must only have one dimension."

# Fit synthetic control
sc = Synth(data, "gdp", "country", "year", 1990, "West Germany", n_optim=100)

maybe optimize.py should delete "size=1"?

else:
    #Dirichlet distribution returns a valid pmf over n_covariates states
    v_0 = self.original_data.rng.dirichlet(np.ones(data.n_covariates), size=1)
    if pen == "auto":
        #if pen =="auto", we have an additional parameter to optimize over, so we append it
        v_0 = np.append(v_0, self.original_data.rng.lognormal(1.5, 1, size=1)) #Still experimenting with what distribution is appropriate
            
@PG408
Copy link
Author

PG408 commented Oct 27, 2024

I successfully ran it after removing the “size = 1” parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant