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

Weights for fitting #10

Open
SamuelWhiteley opened this issue Aug 25, 2022 · 1 comment
Open

Weights for fitting #10

SamuelWhiteley opened this issue Aug 25, 2022 · 1 comment

Comments

@SamuelWhiteley
Copy link

Would you mind please adding a resonator field for a vector of weights to the data? For example if I want to weight the data in order to fit only part of the I and Q vectors, using weights would be a convenient feature. It could be helpful for all models (S21 hanger, S21 transmission, S11 reflection, etc.)

Note this might overlap however with sigmaI and sigmaQ since often weight = 1/sigma^2 for real data. The reason a single vector for weights could be useful though is because a weight of 0 is sigma=infinity, so directly having access to a weights input would be slightly more straightforward.

Thank you.

@FaustinCarter
Copy link
Owner

@SamuelWhiteley I'm inclined to think the cleanest way to handle what you say you want, is to create a new Resonator object from the masked data and fit that instead. That gives you the ability to try several different masks while keeping them all logically separate.

In the meantime, I'm going to plan something of a rework of the scraps fitting system to hand as much of it as possible over to lmfit. This will mean that all the built in fitting takes advantage of their preferred workflow (https://lmfit.github.io/lmfit-py/model.html), which includes the ability to specify weights (as well as lots of other stuff).

Once I have a design plan, I'll post it here to give you some opportunity to comment before I implement.

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

2 participants