Skip to main content

Questions tagged [constraint]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
15 views

Could we impose to a SARIMA model that the sum of predict values equals a given value (in R)?

I work on forecasting in R using a SARIMA model with monthly time series data. However, for the last year, I don't have the details by months but I have the annual value. I want to predict 2023 data ...
Maxime Hautin's user avatar
1 vote
0 answers
28 views

Open-Source Alternative of Closed-Source Swarm Optimization

We are currently using a closed-source software for model optimization. Since it is closed, we have no transparency into the underlying code, which therefore by definition makes it challenging to ...
Oliver Angelil's user avatar
0 votes
0 answers
21 views

Constrain loss function based on input variables

I'm doing a simple regression task using a neural network with two inputs (x1 and x2) and one output (...
Jens Madsen's user avatar
1 vote
0 answers
34 views

How to model the additive components of a random variable whose value is known

I would like to model the variables $Y_1, Y_2, …, Y_n$, which satisfy the constraint $Y_1 + Y_2 + … + Y_n = Y$; where $Y$ (or at least an accurate estimate $\hat{Y}$ thereof) is readily available. ...
Sebastian Chejniak's user avatar
0 votes
0 answers
16 views

Supervised classifier for nested interval data and ordinal classes

I'm having trouble formalizing the following classification problem: Let $x_i$ denote univariate (scalar), continuous, real data points Let $y_i \in \mathbb{N}$ be their corresponding labels Classes ...
themodelguy's user avatar
3 votes
1 answer
66 views

Constrained, Supervised Classification

I am playing around with a classification model, and I would like to know if there are any known methods to achieve what I am looking to do. The data looks something like this: Class id $x_1$ $x_2$ .....
TNoms's user avatar
  • 95
0 votes
0 answers
24 views

Defining parameters so that they obey multiple constraints

I'd like to define parameters $\beta_i$ for $i=1,\ldots,I$ for a problem so that they automatically obey some constraints. The constraints are: $\sum_{i=1,\ldots,I} w_i \beta_i = c_1$ and $\sum_{i=1,\...
Björn's user avatar
  • 33.5k
4 votes
1 answer
93 views

Does every distribution family have a set of maximum entropy constraints?

I am reflecting on these examples of maximum entropy distributions. I am (pleasantly) surprised that various common distribution families have maximum entropy constraints. It got me wondering if ...
Galen's user avatar
  • 9,361
5 votes
2 answers
253 views

How can I fit a distribution to a dataset while forcing it through an exact point in r?

This code was kindly recommended to me in my original question. It returned the same parameter estimates as the software called CRAFT by Aon Benfield. I have also managed to replicate it for the ...
Tom's user avatar
  • 51
2 votes
0 answers
34 views

Relaxed magic-square generator distribution

This question is about a magic square generator, "relaxed" because it's only about one vector (row) in the square independent of all other rows; the individual elements are continuous and ...
Reinderien's user avatar
2 votes
1 answer
256 views

LAVAAN modification indices for constrained parameters

I'm looking for a way to estimate the equivalent of modification indices for parameters that are not zero, but are constrained to be equal. See example below. ...
Mrkwht's user avatar
  • 23
3 votes
0 answers
24 views

Least Squares with Positive Coefficients Restrictions [duplicate]

Consider the following linear model: $$Y_i=\beta_0+\beta_1 X_{i1}+\cdots+\beta_k X_{ik}+\varepsilon_i$$ Here, I want to get the estimate with a positive value restriction $\hat{\beta}_1>0$. That is,...
M.C. Park's user avatar
  • 935
8 votes
3 answers
1k views

Non negative least square on some coefficient

Non negative least square solves $$ y = \alpha^T x \\ s.t. \forall i,~ \alpha_i \geq 0 $$ However, I would like to apply the non negativity constraint only on some coefficient, say only the $\alpha_i,~...
LucG's user avatar
  • 193
2 votes
0 answers
101 views

Estimate variables which sum to zero? [closed]

Assume we have $y_i$ such that $\sum y_i=0$. Assume we have estimation machinery (some machine learning) which can estimate each $y_i$. So we can forget constraint and eastimate each of them, or we ...
Alexander Chervov's user avatar
1 vote
0 answers
45 views

How to generate two matrices with given (constrained to) column-wise and row-wise correlations in R? [closed]

I would like to generate two matrices X and Y, of the same dimensions (n x ...
user369341's user avatar
1 vote
0 answers
138 views

Marginal density of dirichlet distribution

I'm studying BRML. In this book, a Dirichlet distribution is defined as $$ p(\alpha | u) = \frac{\Gamma(\sum_{q=1}^Q u_q)}{\prod_{q=1}^Q \Gamma(u_q)} \delta_0 \left( \sum_{q=1}^{Q} \alpha_q - 1 \right)...
yeomjy's user avatar
  • 11
21 votes
2 answers
6k views

Why is XOR not linearly separable?

Let the function $XOR:\{0,1\} \times \{0,1\} \to \{0,1\}$ be the function defined by $$\begin{align} XOR(0,0) &= 0, \\[6pt] XOR(0,1) &= 1, \\[6pt] XOR(1,0) &= 1, \\[6pt] XOR(1,1) &= 0. ...
lap lapan's user avatar
  • 313
3 votes
0 answers
32 views

Fitting Sparsed Constrained regression with non-negative coefficients adding to 1

I see a similar problem in How do I fit a constrained regression in R so that coefficients total = 1? Specifically, my model is $Y_i= \pi_1 X_1+\pi_2 X_2 +...+ \pi_K X_K +\epsilon_i$ with $\pi_k \ge 0$...
Siddhartha R Dalal's user avatar
0 votes
0 answers
491 views

What is the difference between constrained and unconstrained models

I have a question what is the difference between constrained and unconstrained model or freely estimated model. I am trying to test for chi square difference between them to determine discriminant ...
Sara J's user avatar
  • 1
4 votes
1 answer
187 views

Modeling a functional relationship with Constrained Gaussian Process regression

I searched the site for an answer to this question, but the closest I could find was: Gaussian process where the output is constrained to be 0 or greater which doesn't have an answer. So, I have a ...
DeltaIV's user avatar
  • 18.2k
0 votes
0 answers
60 views

How to Model Constrained Outcome in Multivariate Regression Context

I have a problem in which the ratio of two different outcomes as a function of time $\frac{Y_{1t}}{Y_{2t}}$ is unknown constant $c$. I would like to estimate regression models of the following type: $$...
ML0's user avatar
  • 1
0 votes
0 answers
17 views

Forecasting of ratios that need to addup to 100% [duplicate]

I intend to forecast 'shares' or ratios independently that need to add up to 100% . How can I do this especially when there are >2 ratios to predict. e.g. share of mdot, share of desktop and sahre ...
Roopanjali Jasrotia's user avatar
1 vote
1 answer
793 views

Fix second-order factor loadings to equal in all second-order factors with two first-order factor indicators? CFA / SEM

I am conducting a CFA followed up by a SEM analysis. In my original model I had 13 latent variables. As some of these were highly correlated, I created second-order factors, of which 3 are indicated ...
Onur Sahin's user avatar
1 vote
1 answer
335 views

How can nuisance parameters in Fisher matrix can deteriorate the useful constraints?

I have a Fisher matrix $F$ which has the matrix blocks form like this : $$ F=\begin{bmatrix} A & B\\ C & D \end{bmatrix} $$ The block $A$ is the most important block, in the sense the ...
user avatar
1 vote
0 answers
16 views

Cluster Analysis for data with preexisting cluster membership restrictions

I am trying to see if a particular set of plant morphological data (sepal dimensions, corolla dimensions, etc.) can, through cluster analysis, suggest a number of distinct species in the data set. ...
Ted Lorance's user avatar
1 vote
1 answer
127 views

How to set a constraint for a non-linear least squares problem [closed]

I am trying to fit some data where the cost function is $ax^2 + bx + c$ and I need to have $a+b+c = 1$. How do I set such a constraint in MATLAB or Python?
SEU's user avatar
  • 111
5 votes
3 answers
844 views

Adjusting round-off error so as to have percentages that sum up to $100$

I have non-negative numbers $x_1, \dots, x_n$. These numbers are all percentages rounded to the nearest tenth of a percentage. Unfortunately, I don't have any of the numerators or denominators driving ...
Clarinetist's user avatar
  • 5,057
4 votes
2 answers
397 views

In optimization, is there a distinction between "implicit/natural" and "explicit/designed" constraints?

For example, I wish to optimization a function which has a log term $\log(x)$ Now the very presence of the log term induces a constraint which says $x > 0$. The case $x = 0 $ might be a bit ...
Norman's user avatar
  • 347
1 vote
0 answers
112 views

How would you run a SUR with nonlinear constraints?

Chiappari et al (2012) estimate two Seemingly Unrelated Regressions like this: $$ y_1 = a_1 + b_{11}x_1 + b_{12}x_2 $$ $$ y_2 = a_2 + b_{21}x_1 + b_{22}x_2 $$ Next, they want to test the hypothesis ...
dash2's user avatar
  • 246
2 votes
1 answer
92 views

Sampling the inside of a curve [closed]

Suppose I have a set of points $S$ in the plane, which defines a curve in a discretized fashion. This could be $3\cdot 10^3$ points on the unit circle: But also could be $3\cdot 10^3$ points ...
NoVariation's user avatar
  • 1,399
0 votes
0 answers
29 views

Comparing paired percentages with a constraint

I would like to compare two variables, which are paired and both contain percentages. The sample size shall be large enough (>100), so I do not consider applying any nonparametric method. However, ...
cchien's user avatar
  • 408
1 vote
0 answers
270 views

Generate uniform distribution under multiple constraints

I have to acknowledge that my skill in statistics are really rusted. I would like to implement in Python a uniform distribution that satisfies constraints on the mean, the median, the standard ...
John_Sharp1318's user avatar
2 votes
1 answer
37 views

Resulting shapes when partitioning the constraint matrix $\boldsymbol{A}$ in linear programming

\begin{equation} \boldsymbol{A} = \begin{bmatrix} {1}_n^\top \otimes \mathbb{I}_m \\ \mathbb{I}_n \otimes {1}_m^\top \end{bmatrix} \in \mathbb{R}^{(m+n)\times mn} \end{equation} If the above matrix ...
develarist's user avatar
  • 4,015
10 votes
2 answers
5k views

Proving Ridge Regression is strictly convex

Definition of ridge regression $$min_\beta||y-X\beta||_2^2+\lambda||\beta||_2^2, \lambda\ge0$$ you can prove a function is strictly convex if the 2nd derivative is strictly greater than 0 thus But ...
user8714896's user avatar
1 vote
0 answers
222 views

Clustering with constraints on group composition and size

Let's say that I know that in my data I have underlying clusters (if it helps, it may be reasonable to assume that I might even know how many) that are of a fixed size (let's say 4) and each cluster ...
Björn's user avatar
  • 33.5k
2 votes
0 answers
317 views

More on Fisher Information matrix with constraint

I have a similar Maximum Likelihood problem setup and a follow-up question to the question asked here My constraints involve vector parameters $\vec{w}=\{w_1,w_2,\cdots,w_K\}$ and $\vec{\mu} = \{\mu_1,...
alan's user avatar
  • 21
4 votes
1 answer
679 views

How does glmnet put constraints on coefficient upper and lower bounds?

Based on glmnet documentation at https://web.stanford.edu/~hastie/glmnet/glmnet_alpha.html Coefficient upper and lower bounds These are recently added features that enhance the scope of the models. ...
Jerome's user avatar
  • 41
3 votes
1 answer
183 views

Minimize $f(A,B)$ s.t. $\text{exp}(A)^T \text{exp}(B)=J_K$

I have a function $f(A,B)$ that maps a pair of two (tall) matrices, $A$ and $B$, to a scalar cost that I want to minimize. $A$ and $B$ both have $K$ columns. I also want to impose a set of equality ...
Ruben van Bergen's user avatar
0 votes
1 answer
46 views

Constraining a parameter in a 4 level variable In a propensity score regression

I’m generating a propensity score using logistic regression in SAS. The model predicts compliance with a quality measure. I will match patients into groups who actually complied and not complied with ...
Sean T's user avatar
  • 3
0 votes
0 answers
44 views

Constrains on the coefficients of SARIMA

I am trying to generate synthetic time-series through SARIMA random process by defining the model coefficients manually. Could any one help me how to generate coefficients? What are the constraints on ...
AidinZadeh's user avatar
2 votes
0 answers
4k views

Convex multiple variables optimization problem with constraints in python [closed]

I am currently trying to implement the following optimization problem in python (in order to resolve it with scipy.optimize.minimize). Please note that $\alpha$ is given, $T$ is the number of ...
Nipper's user avatar
  • 121
1 vote
1 answer
99 views

How can I shift the average probability keeping constraint (0.0:1.0)?

I have a large datasets of values that range from 0 to n. I am interpreting the values as probabilities for a later pseudo-random selection process. To make the values serve as probabilities, I ...
philologon's user avatar
1 vote
0 answers
175 views

What analysis can I perform for constrained optimalization of coil parameters

I have about 20 discrete sets of variable coil parameters that I need to assign values to, satisfying given constraints. The objective is to minimize the manufacturing cost (and to satisfy the ...
Sisak's user avatar
  • 11
0 votes
0 answers
2k views

Learning Lagrangian multiplier for regularization term in the loss function

There is a method for imposing physical constraints on the neural networks, in which a physics-based loss is added to the loss function. This term is usually a function of the output of the network. ...
Blade's user avatar
  • 655
1 vote
0 answers
114 views

Multiple Linear Regression with constraints that should satisfy a curve

I would like to estimate a multiple linear regression model with 15 coefficients like this: Y=a1x1+a2x2+a3x3+.....+a15x15+e I have a set of data that include Y(29x1) and X(29x15). I want ...
Trung Hoang's user avatar
0 votes
0 answers
26 views

Is there an idiomatic way of setting constraints on parameters in R?

Let's say I have 2 categorical variables foo and bar that have the same 4 levels A, B, C and D I have a response variable $Y$, ...
swoutch's user avatar
  • 101
0 votes
0 answers
122 views

How to impose a global constraint on cost function of a neural network?

I have a training set of time series samples. Each sample is composed of a noise process (input) and the corresponding trajectory (output) which is the solution of the stochastic differential equation ...
New Developer's user avatar
2 votes
0 answers
130 views

How to update symmetric, positive definite matrix in the constrained Hamiltonian Monte Carlo algorithm?

original post I'm working on the implementation of the Hamiltonian Monte Carlo (HMC) algorithm which includes a covariance matrix parameter, say $\Sigma$. Let $\Phi$ be the (initialized) momentum ...
inmybrain's user avatar
  • 538
1 vote
0 answers
153 views

Regression with Constrained fitted value

I would like to fit a (generalized) linear regression model such that that the predicted values must be greater than one of the input variables. For example... $\hat{age} =\beta_{1}*\text{age of ...
RayVelcoro's user avatar
  • 1,189
2 votes
0 answers
134 views

Binary classification where I know only one candidate can be positive

I have a binary classification problem, where given a thing I need to determine whether it's of class A or class B. Now, I also have additional information: For each 30 examples for which I need to ...
ivanibash's user avatar
  • 175