Skip to content

Permit negative P(r) in DeerLab #458

Answered by HKaras
schmidtnedlitz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Thomas,

Many thanks for you question. I have converted it to a discussion so it remains open for any other interested users.

Whilst DeerLab was primarliy designed to solve non-negative least squares (nnls) problems it can also handle other cases. The distance distribution P is actually just a linear parameter of the model with a lower and upper bound. By default in dipolar model we set its lower bound to be 0, but this can be changed to -inf.

This would be some code that would work well. There is no need to change anything in the fit function.
model.P.lb = np.ones(model.P.lb.shape) * -1* np.inf

Does your problem also permit P to be positive or is this an entierly negative P?
There does…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@schmidtnedlitz
Comment options

@HKaras
Comment options

Answer selected by HKaras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #457 on September 01, 2023 17:04.