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
4
votes
1 answer

How do I Interpret Silhouette Coefficient from K-Means Clustering?

I am practicing K-Means clustering using sklearn package. I am working with sample shopping dataset, which consists of how much each customers spent in each item categories (i.e., food, fashion, digital, etc.) There are 42 features, meaning 42 item…
2D_
  • 571
  • 1
  • 9
  • 17
4
votes
2 answers

piecewise linear interpolation function in python

I'm fairly new to programming and thought I'd try writing a piecewise linear interpolation function. (perhaps which is done with numpy.interp or scipy.interpolate.interp1d) Say I am given data as follows: x= [1, 2.5, 3.4, 5.8, 6] y=[2, 4, 5.8, 4.3,…
Nima Geran
  • 115
  • 1
  • 3
  • 10
4
votes
1 answer

R: Special contrasts within an interaction effect

Within the context of a 2-way ANOVA, I would like to enter contrast levels for one factor (10, 20, 30 degrees) within levels of another factor (SpeciesA, SpeciesB). This assumes the interaction effect is significant so the contrasts cannot simply be…
B. Bingham
  • 41
  • 1
  • 2
4
votes
2 answers

R Multiple Regression Loop and Extract Coefficients

I have to perform multiple linear regression for many vectors of dependent variables on the same matrix of independent variables. For example, I want to create 3 models such that: lm( d ~ a + b + c ) lm( e ~ a + b + c ) lm( f ~ a + b + c ) from the…
3
votes
1 answer

Linear regression asymmetric coeffcient - dual beta in python

In a regression framework, suppose we have two independent variables x1 and x2 and we want different slopes depending on x1>0 or x1<0, and same with x2. This sort of model is used in the computation of the dual beta, if you need an entry point to…
PeCaDe
  • 277
  • 1
  • 8
  • 33
3
votes
3 answers

How can I get the coefficients from nlsList into a dataframe?

Is there a way to extract just the estimates from nlsList()? Sample data: library(nlme) dat<-read.table(text="time gluc starch solka 1 6.32 7.51 1.95 2 20.11 25.49 6.43 3 36.03 47.53 10.39 6 107.52 166.31 27.01 12 259.28 305.19 113.72 24 283.40…
3
votes
1 answer

Visualization of coefficients in R (dot-chart)

I want to plot my coefficients from three different models to show the shrinkage effect of the estimated coefficients with a dot-chart. For more context: I am working with a hierarchical linear model and want to compare those estimates with the…
3
votes
2 answers

How to generate Coefficient >0 in lasso regression or any other method?

I am running below code to generate all the coefficient positive: from sklearn.linear_model import Lasso pos = Lasso(positive=True) pos.fit(X,y) list(pos.coef_) the above code give me positive coefficient or "0" but I need all to be positive with…
3
votes
2 answers

How to extract residuals and read coefficients from the function Anova()?

I use the function Anova() in package car to perform a test with type III. But I have no idea how to extract the residuals or how to get the information of parameter estimates. Is there some way to do these like residuals(model) and…
A. Caikov
  • 51
  • 5
3
votes
1 answer

plot_summs() change size of plotted regression coefficients

I'm using plot_summs() from the jtools package to plot regression coefficients. I'm trying to make the plot big enough to see for a presentation and I figured out how to change the size of everything except the actual plotted coefficients (see the…
3
votes
0 answers

Compare beta coefficients of the same regression

is there a way to compare (standardized) beta coefficients of one sample and regression without generating two models and conducting an anova? Is there a simpler method with e.g. one function? For example, if I have this model and would want to…
Karen H
  • 43
  • 2
3
votes
2 answers

Python equivalent for R StepAIC for Logistic Regression (direction='Backwards')

I tried to emulate stepAIC function in R doing it "manually" but it takes forever (I posted just the first two tries). Is there something similar to stepAIC function (that eliminates one variable with highest p-value at iteration and minimize AIC)…
Porridge
  • 107
  • 2
  • 13
3
votes
1 answer

sympy - how to additively combine exponents when expanding?

My main goal is to identify coefficients in front of exponentials of the form exp(1j*k*r) in expressions such as: (z1*exp(1j*k1*r1) + z2*exp(1j*k2*r2) + c.c.)**2 by first expanding and then using the coeff tool in sympy. The problem is that I…
A. S.
  • 31
  • 3
3
votes
1 answer

Equating symbolic coefficients

I would like to seek y particular of ODE y'' - y' - 2y = 4x^2 I made the following script: syms x A0 A1 A2 ypa = A2*x^2+A1*x+A0; % y_p assume cyp = diff(ypa,2) - diff(ypa) - 2*ypa % according to ODE P1 = 4*x^2; P2 = cyp ; % Equating P1 and P2 C =…
User1961
  • 131
  • 8
3
votes
1 answer

predict.lm with arbitrary coefficients r

I'm trying to predict an lm object using predict.lm. However, I would like to use manually inserted coefficients. To do this I tried: model$coefficients <- coeff (where "coeff" is a vector of correct coefficients) which would indeed modify the…
OnlyAL
  • 81
  • 9
1 2
3
32 33