Questions tagged [quadratic]

Pertains to squares or squaring. Use this tag for questions relating to quadratic equations, quadratic regression, and similar concepts in the context of programming as defined in the Help Center. It may also be used for questions regarding quadratic probing and quadratic time complexity.

Quadratic means to the second (2nd) power, that means, squares (in algebra), or squaring. This tag is used for questions relating to quadratic equations, regression, and similar programming contexts involving quadratic polynomials or terms.

A quadratic polynomial is a polynomial of degree 2. All quadratic polynomials of a single variable x is of the form ax^2 + bx + c where the quadratic coefficient a != 0. The graph of a quadratic function is a parabola, with open end up if a > 0, and down if a < 0. All quadratic polynomials have exactly two complex roots, and can have either two, one, or zero real roots. The famous quadratic formula, applicable for all quadratic polynomials ax^2 + bx + c with real or complex coefficients a,b,c , is given by x = (-b ± sqrt(b^2 - 4*a*c)) / (2*a).

Here are the graphs of three quadratic functions with color coding

three quadratics

A quadratic regression is a method of finding a parabola, represented as a quadratic polynomial of best fit in a set of data. The chart below shows an example of finding a parabola extrapolating the known data points.

Source: https://www.varsitytutors.com/hotmath/hotmath_help/topics/quadratic-regression

Quadratic Complexity means complexity of O(n^2). That means, it grows similar to a positive quadratic function ax^2 + bx + c, a > 0 as x grows, precisely, f(x) == O(x^2) if f(x)/x^2 is constant. There are two forms of quadratic complexity: quadratic space and quadratic time, indicating that this program or algorithm asymptotically requires extra memory space or took time equal to the square of the size of the input n respectively. Selection sort is an example of a quadratic time algorithm. Linear or better complexity is also within quadratic complexity.

420 questions
0
votes
1 answer

How to get_lines from point to point in manim?

When I try to get_horizontal_line from one dot to another it goes from the y-axes. I want that the dashedline comes from the point [1;1] to point [3;1]. Because now it comes from [0;1] to[3;1]directly from the axis coordinate. I don't know how to…
0
votes
1 answer

Calculate intercepting vector?

I am trying to calculate an intercepting vector based on Velocity Location and time of two objects. I found an post covering my problem but was left over with some technical questions i could not ask because my reputation is below 50. Calculating…
Schrottiy
  • 35
  • 5
0
votes
1 answer

Model is infeasible in Gurobi although it has a feasible solution

I am attempting to solve a non-convex quadratic optimization problem using Gurobi, but I have encountered an issue. Specifically, I have a specific objective function; however, I am only interested in finding a feasible solution. To do this, I tried…
0
votes
1 answer

How to draw a quadratic plateau in ggplot?

This is example of data and graph ##generated date GN<- c(1,2,3,4,5,6,7,8,9,10,11,12,13) Yield<- c(10,30,50,65,75,80,90,100,105,110,115,115,116) dataA<- data.frame(GN,Yield) ##ggplot ggplot(data=dataA, aes(x=GN, y=Yield))+ …
Jin.w.Kim
  • 599
  • 1
  • 4
  • 15
0
votes
0 answers

Linear spline loop to quadratic spline loop

def LinearSpline(x, fx): #to determine the coefficients ''' Valid call: coeffs = LinearSpline(x, fx) Inputs: x : (array) x values at which we have f(x) values. fx : (array) f(x)values associated with x values. Output: coeffs : (array)…
0
votes
2 answers

After running code, I received the Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '-' error

The problem is " Conversion = '-'". The source code is listed below. This is a program used to caculating the value of Coefficent A, B, and C based on the quadratic function. import java.util.Scanner; public class RootsTestHamer { public static…
Brando
  • 1
  • 2
0
votes
0 answers

Quadratic fit function of two large data samples in python to predict

using this csv: https://docs.google.com/spreadsheets/d/1QbFIUE1AcFCOgDZH5K2vPColxXeBVDV-sJhS9On2BYY/edit?usp=sharing I'm trying to figure out how to write a program to fit a quadratic function to predict the change in global temperature (y) as a…
0
votes
0 answers

how to fix the error in polynomial to quadratic optimization?

let me explain my problem in more detail. I have a model like the following model (1) function [c,ceq] = kendala(x) c(1) = x(1)*x(2)*x(3)*x(4)*x(5) -72; c(2) = x(1)*x(2) + 8*x(3)^2 - 96; c(3) = x(3)^2- 5*x(2)*x(4) - 8; c(4) = x(3)*x(4) -…
Raya
  • 1
0
votes
0 answers

Confidence bounds for coefficients of a fit of data set obtained with another fit

I fitted an equation to a set of data points. Then I substracted the fit previously obtained to another set of data points. After that, I fitted another equation to this new data (result of the substraction). What happens with the confidence bounds…
0
votes
2 answers

How to get the value of explanatory variable at the point where the response variable is at its maximum? (R)

I have a multivariate binomial GLM with one quadratic (dist_Roads) and multiple linear terms: GLM <- glm(formula = Presence ~ dist_NP_boundary + dist_Villages + dist_Water + dist_Grassland + dist_Roads + I(dist_Roads^2), family = "binomial", data =…
Kris
  • 21
  • 5
0
votes
0 answers

Constrained regression : Returns-based style analysis / Hedge fund replication

After reading some papers on Hedge fund replication Hasanhodzic & Lo and more globally on returns-based style analysis Can active equity managers be cloned using factor funds, I would try by myself to see If I can roughly copy an Equity index or…
0
votes
1 answer

How to get the vertex value of quadratic term in GLM in R?

I have a quadratic term in a GLM and I am interested in the vertex value (+ the standard error and confidence interval of the vertex) of the quadratic term. To my knowledge, there is no automatic function for this purpose in R, and I am unable to…
Kris
  • 21
  • 5
0
votes
0 answers

Quadratic constraint with ROI package

I have a quadratic optimization function (solution on x) with a quadratic constraint that I want to be on (x-y) rather than on x as i currently have it. I am currently working with the ROI package and the alabama solver. x <- c(0.2, 0.3, 0.1, 0.25,…
GT213
  • 89
  • 6
0
votes
1 answer

Is there a way I can make this program shorter/simpler or any improvements I can make to it?

I have written a program that can convert a Quadratic equation written in standard form to vertex form. I am a beginner in Python and coding in general. I have posted programs on StackOverflow before but have received a lot of criticism towards…
Patman1O1
  • 5
  • 4
0
votes
0 answers

Why do I need to use the Math.floor while adding the roots of the quadratic equation in Java

While I was doing the code to pass the roots of quadratic equation using an array list, I encountered the wrong answer for the given test case 752 904 164. Its answer was -1,-1, but my answer was 0,0, so I tried searching for the solution and found…