Questions tagged [coefficients]

In mathematics, a coefficient is a multiplicative factor in some term of a polynomial, a series or any expression; it is usually a number, but in any case does not involve any variables of the expression.

In mathematics, a coefficient is a multiplicative factor in some term of a polynomial, a series or any expression; it is usually a number, but in any case does not involve any variables of the expression.

495 questions
3
votes
1 answer

Parse Coefficient of an Linear equation

In java i am trying to find the coefficients of a linear equation to find solution of linear equation in my calculator application for example : 3x +2*(6x-3) = 2 -4x what i am dying to get is the coefficients of x and the constant in the form …
erluxman
  • 18,155
  • 20
  • 92
  • 126
3
votes
0 answers

explanation to shift pixels code snippet

I have ported to the new C++ api the code from this answer. However, while I understand the most of the code I cannot get the idea behind the calc_shift() function and how the pixels shift is extracted. If someone could provide me an explanation I…
ttsesm
  • 917
  • 5
  • 14
  • 28
3
votes
2 answers

How to fix intercept value of glm

This is the example that I work on it : data2 = data.frame( X = c(0,2,4,6,8,10), Y = c(300,220,210,90,80,10)) attach(data2) model <- glm(log(Y)~X) model Call: glm(formula = log(Y) ~ X) Coefficients: (Intercept) X …
Cherif
  • 33
  • 1
  • 6
3
votes
1 answer

Is it possible to hide the coefficients that are from factors in R lm()?

I have a model with two types of many different fixed effects, and I am only interested in a few regressors and not the fixed effects themselves. I find it easier to include the as.factor variables to have fixed effects (rather than use a within…
wolfsatthedoor
  • 7,163
  • 18
  • 46
  • 90
2
votes
1 answer

Polynomial regression models return different values: `lm(dist ~ speed+I(speed^2), data=cars)` and `lm(dist ~ poly(speed, degree = 2), data = cars)`

Using the cars data in R, I would like to create a polynomial regression model with varying degree values. Through research online I have found two methods of creating these models: library(tidyverse) data(cars) # method 1 polyreg_deg2 <- lm(dist ~…
2
votes
3 answers

Sympy: drop terms with small coefficients

Is it possible to drop terms with coefficients below a given, small number (say 1e-5) in a Sympy expression? I.e., such that 0.25 + 8.5*exp(-2.6*u) - 2.7e-17*exp(-2.4*u) + 1.2*exp(-0.1*u) becomes 0.25 + 8.5*exp(-2.6*u) + 1.2*exp(-0.1*u) for…
Tamas Ferenci
  • 424
  • 2
  • 10
2
votes
1 answer

Add regression equation and R2 to plot in Julia

I have the following scatter plot with smoothed regression line: using Plots using DataFrames using GLM df = DataFrame(x = collect(1:7), y = collect(1:7)+rand(7)) scatter(df.x, df.y, smooth = :true, label =…
Quinten
  • 35,235
  • 5
  • 20
  • 53
2
votes
3 answers

polynomial fitting of a signal and plotting the fitted signal

I am trying to use a polynomial expression that would fit my function (signal). I am using numpy.polynomial.polynomial.Polynomial.fit function to fit my function(signal) using the coefficients. Now, after generating the coefficients, I want to put…
MRR
  • 45
  • 1
  • 6
2
votes
2 answers

Extracting coefficients in sympy is only working for certain symbols

If I define the following equation import sympy as sp x00, x01, x02 = sp.symbols('x_{00} x_{01} x_{02}') x10, x11, x12 = sp.symbols('x_{10} x_{11} x_{12}') x20, x21, x22 = sp.symbols('x_{20} x_{21} x_{22}') px0, px1, px2 = sp.symbols('p_{x0}…
TheIdealis
  • 707
  • 5
  • 13
2
votes
0 answers

Bootstrap function for dataframe - passing a function as an argument in R

I am trying to create a bootstrap function for my assignment. The requirement is as follows: Compute the bootstrap standard error for: - mean() and - median() and - the top quartile and - max() and - the standard deviation of the…
2
votes
0 answers

Eigen linear regression: avoid explicit 1's column

I need to solve a linear system with Eigen for linear regression. Normally to compute the constant coefficient it is assumed that the data has an additional column, composed fully of 1s. Then the solve() can compute it correctly. I was wondering…
Svalorzen
  • 5,353
  • 3
  • 30
  • 54
2
votes
1 answer

Is there a way to display regression coefficients in a pandas data frame for categorical independent variables?

I have built a multiple linear regression model and I found the coefficients using model.coef_. I want to make a pandas data frame which displays each of the factors and its coefficient. pd.DataFrame(model.coef_, x.columns, columns =…
Sona
  • 35
  • 1
  • 5
2
votes
1 answer

Dice coefficient for image segmentation evaluation

I'm trying to implement dice coefficient, so I could compare segmented image to ground truth image. However, the output of the dice coefficient seems to be incorrect as segmented image is around 80% similar to the ground truth image. The output of…
2
votes
1 answer

Plot combining regression coefficients (partial derivatives) with CIs in R, lincom + coefplot or plotbeta?

Most of the time we run a regression with interactive terms, we are interested in a partial derivative. For example, consider the model below, If I am interested to know the effect of X1 on P(Y), or the partial derivative of X1 on P(Y), I need the…
Thiago
  • 173
  • 11
2
votes
1 answer

Return coefficients after Pipeline, GridSearch, and Target Transformation

This question has been asked before, here and here. When I try those answers, my error message is that my model has no attribute of coef. I use a pipeline, gridsearch, and Target Transformation. I can access the model itself, but my error message is…
Jack Armstrong
  • 1,182
  • 4
  • 26
  • 59