Questions tagged [regression]

Regression analysis is a collection of statistical techniques for modeling and predicting one or multiple variables based on other data.

Wiki

Regression is a common applied statistical technique and a cornerstone of machine learning. Various algorithms and software packages can be used to fit and use regression models.

In other words, regression is a statistical measure that attempts to determine the strength of the relationship between one dependent variable (usually denoted by Y) and a series of other changing variables (known as independent variables). Typically the dependent variables are modeled with probability distributions whose parameters are assumed to vary (deterministically) with the independent variables.

Tag usage

Questions on should be about implementation and programming problems, not about the statistical or theoretical properties of the technique. Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics and machine learning.

Read more:

9532 questions
9
votes
1 answer

Prediction - Neural network for regression predicts same value

I am trying to predict median value of owner-occupied homes, its a worked example which is giving a good…
Sam
  • 191
  • 1
  • 12
9
votes
1 answer

Error in summary quantreg backsolve

When I run a quantile regression in R, using the quantreg package, and then I run summary(quantregObject), I get this error message: Error in base::backsolve(r, x, k = k, upper.tri = upper.tri, transpose = transpose, : singular matrix in…
Alberto
  • 91
  • 1
  • 2
9
votes
3 answers

How to estimate goodness-of-fit using scipy.odr?

I am fitting data with weights using scipy.odr but I don't know how to obtain a measure of goodness-of-fit or an R squared. Does anyone have suggestions for how to obtain this measure using the output stored by the function?
Ashley
  • 123
  • 1
  • 5
9
votes
1 answer

Setting an upper bound of 0 on a 3d loess smoothing with negative values in R

I have a bit of a bizarre question, but hoping someone can help me. I am attempting to create a surface plot of the bottom of a lake and then add some points showing plant frequency for a visual of where aquatic plants are occurring throughout the…
9
votes
3 answers

R: function passed as argument is not found

I am trying to write a simple iterative reweighted least squares algorithm in R. I want to pass a function as argument for the calculation of the weights, but unfortunately R complains that the function cannot be found. Any ideas what I am doing…
linuxfever
  • 3,763
  • 2
  • 19
  • 43
9
votes
2 answers

R nls singular gradient

I've tried searching the other threads on this topic but none of the fixes are working for me. I have the results of a natural experiment and I want to show the number of consecutive occurrences of an event fit an exponential distribution. My R…
sessmurda
  • 167
  • 1
  • 2
  • 8
9
votes
4 answers

neural networks regression using pybrain

I need to solve a regression problem with a feed forward network and I've been trying to use PyBrain to do it. Since there are no examples of regression on pybrain's reference, I tried to adapt it's classification example for regression instead, but…
Alberto A
  • 1,160
  • 4
  • 17
  • 35
9
votes
3 answers

getting predictor names in R regression

I have an R code that is running about 100 regression models, grabbing R^2 values and printing them to a csv file as follows: filename<-"Reg_Results.csv"; cat("Setting,Origin Region,Destination Region,R^2\n",file=filename,append=FALSE); …
Baykal
  • 569
  • 2
  • 10
  • 15
9
votes
1 answer

Is there a function or package which will simulate predictions for an object returned from lm()?

Is there a single function, similar to "runif", "rnorm" and the like which will produce simulated predictions for a linear model? I can code it on my own, but the code is ugly and I assume that this is something someone has done before. slope =…
PirateGrunt
  • 404
  • 4
  • 11
9
votes
2 answers

R multinom() function stops after 100 iterations, what is the reason?

I have quite a relatively large number of data, it has 80 columns and approx 220, 000 rows When I'm attempting to use nnet's multinom() function to perform a mutlinomial logistic regression on unordered multi categorical data the function seems to…
chutsu
  • 13,612
  • 19
  • 65
  • 86
8
votes
3 answers

RandomForest for Regression in R

I'm experimenting with R and the randomForest Package, I have some experience with SVM and Neural Nets. My first test is to try and regress: sin(x)+gaussian noise. With Neural Nets and svm I obtain a "relatively" nice approximation of sin(x) so the…
user1206729
  • 81
  • 1
  • 1
  • 2
8
votes
1 answer

R two regressions from one table

I am trying to plot two different regression lines (with the formula: salary = beta0 + beta1D3 + beta2spending + beta3*(spending*D3) + w) into one scatter plot by deviding the data I have into two subsets as seen in the following code: salary =…
Mark
  • 83
  • 4
8
votes
1 answer

Train multi-output regression model in pytorch

I'd like to have a model with 3 regression outputs, such as the dummy example below: import torch class MultiOutputRegression(torch.nn.Module): def __init__(self): super(MultiOutputRegression, self).__init__() self.linear1 =…
user1315621
  • 3,044
  • 9
  • 42
  • 86
8
votes
2 answers

ValueError: Data cardinality is ambiguous. Make sure all arrays contain the same number of samples

This is a regression problem, where I want to generate 5 float values from each image of size 224 x 224. So I use fully connected networks with 5 nodes in the last layer. But doing so in keras gives me the following error: import keras, os import…
8
votes
1 answer

Fitting two curves with linear/non-linear regression

I need to fit two curves(which both should belong to cubic functions) into a set of points with JuMP. I've done fitting one curve, but I'm struggling at fitting 2 curves into same dataset. I thought that if I can distribute points to curves - so if…