cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Minerr constraint weight

payman
13-Aquamarine

Minerr constraint weight

Hello All,

Could you please briefly explain about the constraint "weight" factor for the Minerr routine? How does it work and how it can be defiend?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:payman)

You pass minerr a vector of residuals, which is the differences between the fitted function and the data points. For each point you have y[i-f(x[i), and for N points you therefore have N residuals. They are all equally weighted in the fit. If you add a constraint for a parameter, say p1>2, there is an error in that constraint if p1<2. That error is weighted exactly the same as each of the N residuals. Basically, you have N+1 errors in the fit and minerr will try to minimize the sum of the squares of those errors, with no particular preference given to the error in the constraint. You can change the weighting by multiplying any of the N+1 errors by some factor that either makes it larger or smaller. If you want a hard constraint you need to weight it very heavily. To do that rearrange the constraint and multiply by a very large number: (p1-2)*10^15>0.

View solution in original post

1 REPLY 1
RichardJ
19-Tanzanite
(To:payman)

You pass minerr a vector of residuals, which is the differences between the fitted function and the data points. For each point you have y[i-f(x[i), and for N points you therefore have N residuals. They are all equally weighted in the fit. If you add a constraint for a parameter, say p1>2, there is an error in that constraint if p1<2. That error is weighted exactly the same as each of the N residuals. Basically, you have N+1 errors in the fit and minerr will try to minimize the sum of the squares of those errors, with no particular preference given to the error in the constraint. You can change the weighting by multiplying any of the N+1 errors by some factor that either makes it larger or smaller. If you want a hard constraint you need to weight it very heavily. To do that rearrange the constraint and multiply by a very large number: (p1-2)*10^15>0.

Top Tags