for issues related to linear regression modelling approach
2
votes
0answers
38 views
unexpected predict() result for linear regression in R
I'm working on a code that predict an hourly rental rates of bikes based on historical data. Data have many attributes (shown below), and to fit the model I used linear regressions models , then I ...
2
votes
0answers
19 views
Why does regtol.int() resort my X variable in ascending order?
I'm pretty new at R, so I guess I must be doing something wrong. I have a dataset named "series" with two columns, V1=CP and V2=CU, and I want to perform a linear regression with CU as the independent ...
2
votes
0answers
193 views
R - Fitting a constrained AutoRegression time series
I have a time-series which I need to fit onto an AR (auto-regression) model.
The AR model has the form:
x(t) = a0 + a1*x(t-1) + a2*x(t-2) + ... + aq*x(t-q) + noise.
I have two contraints:
Find ...
2
votes
0answers
248 views
What is wrong in this Python code for Regularized Linear Regression?
I wrote code with numpy(theta, X is numpy array):
def CostRegFunction(X, y, theta, lambda_):
m = len(X)
# add bias unit
X = np.concatenate((np.ones((m,1)),X),1)
H = np.dot(X,theta)
...
1
vote
0answers
68 views
Performance of adaptive signal processing algorithm for noisy input
I am taking a course on signal processing and have been looking at various algorithms performance in presence of additive noise of different SNR. I was implementing Least Mean Square (LMS) algorithm ...
1
vote
0answers
38 views
Cost function not decreasing in gradient descent implementation
I am trying implemented batch gradient descent in C language. The problem is, my cost function increases dramatically in every turn and I am not able to understand what is wrong. I checked my code ...
1
vote
0answers
88 views
Pandas Rolling OLS Bug with Version 0.12.0
I have the following example data for performing a rolling OLS calculation (here I am doing it from the debugger):
(Pdb) rhs
['Yield']
(Pdb) lhs
'Returns'
(Pdb) min_periods
12
(Pdb) window
60
...
1
vote
0answers
72 views
Plotting a curve on a scatter (linear regression) plot
I have a the following plot in R:
I used the following code to build it:
df <- read.csv("C:/temp/df.csv")
df.x <- df$DR
df.y <- df$GB
df.fit = lm(df.y ~ df.x)
plot(df.x,df.y,
...
1
vote
0answers
40 views
Limit to the number of explanatory variables that R's BMA package can handle?
Using R's BMA (Bayesian Model Averaging) package, I want to run the following code:
result = bic.glm(x,y,prior.param = c(1,1,1,1,0.5,1,0.5,0.5,0.5,1,1,1,1,1,0.5,1,
1,1,1,1,1,1,1,1,1,1,1,1,0.5,1), ...
1
vote
0answers
142 views
Multi-dimensional regression with Vowpal Wabbit
I have an unusual regression problem that I'm trying to fit into vowpal wabbit. I'm trying to learn a set of regressors {r_m(x)} that train on the data set {(x_n, h_n[m])} for n=1 to n=N, where m ...
1
vote
0answers
82 views
Gaussian basis function selection - Linear Regression
I'm looking to set up a linear regression using 2D Gaussian basis functions. My input training variables cover a two dimensional space. Before applying the machine learning (Bayesian linear ...
1
vote
0answers
336 views
In R: Calculation error using lmList for linear regression in groups
generally, it is not rocked science to fit a linear model and use it out-of-sample. Nevertheless, i struggle to implement the linear regression in groups. The r-code given below illustrates the ...
1
vote
0answers
82 views
Using percentiles as predictors - good idea?
I am thinking about a problem which is to predict log(spend) of a customer using linear regression.
I am considering what features to use as input and wondering if it would be ok to use the ...
1
vote
0answers
235 views
What non-negative linear models are supported/planned in scikit-learn?
Scikit-learn offers a large variety of useful linear models. However, I am working on a problem which is linear with non-negativity constraints (i.e. solution variables should be non-negative).
I ...
1
vote
0answers
478 views
Using stepAIC to make out of sample predictions
just had a quick question on using Step AIC to make prediction. I'm a beginner in R, so please pardon if the solution is obvious. Tried searching around but couldn't really find what I was looking ...
1
vote
0answers
562 views
Trouble installing MathNet.Numerics in VS2010 Express, System.Numerics is missing?
I'm new here, just getting my feet wet writing my first Windows Phone 7 app. Specifically, I need to do linear regression on some data to get a simple y=Ax^2+Bx+C best fit curve. After some ...
1
vote
0answers
220 views
Java library for computing a multi-dimensional line of best fit?
I'd like a (free) library or other method that can take N data points with M variables each and compute a line of best fit those data points. Speed is more necessary than exactness. Are there ...
1
vote
0answers
273 views
linear regession model testing with regsubsets time and correctness
I have 2700 observations with 60 characteristic columns and 3 response variables. I am analyzing the data in R. At first I estimated a model with 34 of the characteristics based on the R^2 value. ...
1
vote
0answers
1k views
How to draw the best fit line with c#.net
I have been trying to do a regression analysis on some data points with c#.net. Can anyone suggest some references to me to be able to plot the data points as well as the best fit line on one chart ...
0
votes
0answers
15 views
reference dummy coding with regression in matlab
Thanks in advance for the help
I have a set of data that is composed of multiple categorical predictors and a single numerical response. I want to use regression to predict the response. Matlab ...
0
votes
0answers
36 views
Reading data into linear regression C program
Below is the code I've modified from Numerical Recipes. My x will represent voltage in and my y will represent the digital code out. I am still pretty new to programming and this is also my first time ...
0
votes
0answers
15 views
How to use Wald Test properly
I would like to test the null hypothesis that all coeffcients of my categorical variable with 4 Levels are really zero. I`m new to the R family. And just have some problems to implement that question. ...
0
votes
0answers
5 views
Defining a custom cost function in linear regression
For a linear model, I want to define a cost function penalizing certain errors more than others. For instance, assuming both positive and negative outcomes a sign error (forecasted -1, observed +1) ...
0
votes
0answers
77 views
R stepwise regression with non-negative coefficients
I'm new to the R community, and I wonder if there is a way to restrict the coefficients to be non-negative in a stepwise regression?
I tried to use nnls for non-negative linear regression, and step ...
0
votes
0answers
33 views
mediation analysis when mediator is categorical (SPSS)
I want to do a mediation analysis, with the following variables:
X: Independent variable: Categorical (2 levels)
M: Mediator: Categorical (5 levels)
Y: Dependent variable: Continuous
Following ...
0
votes
0answers
38 views
Error while using stastmodels' WLS: SVD did not converge
I've written an algorithm for a cascaded boosting classifier using WLS (weighted least squares regression) in statsmodels, and have been able to successfully run it a few times. I used it with a few ...
0
votes
0answers
4 views
What could be the reason of low dw stat value and how can we increase the same?
I am running a linear regression model in R to find out the Key Business Drivers. My dw stat is coming out to be 0.75. This value of dw stat is not acceptable as this signifies there is some auto ...
0
votes
0answers
41 views
Can “glmfit” be used for logistic regression as a classification type
"glmfit" is a command provided by matlab. Can "glmfit" be used for logistic regression as a classification problem?
I am getting this doubt because it is mentioned in this link ...
0
votes
0answers
24 views
How to implement linear classification for given image
I have a image that stored at here. I want to use linear classification for the given image.That mean I must find the w and b of linear function y=wx+b. But I don't know which is y value. Could you ...
0
votes
0answers
16 views
Minitab - Linear Regression Line only when Line >= 0
I'm new to MiniTab, but I've created a Scatterplot graph with a linear line of regression however I want the regression line to only exist when it is >= 0 in accordance with the y-values. The y-values ...
0
votes
0answers
42 views
Liblinear bias parameter interpretation
Could you tell me whether the bias is the same as the intercept/constant (beta0) if I were to write it out? Or is this something fundamentally different and if so, could you explain the difference ...
0
votes
0answers
30 views
Interpreting the R Polynomial Regression output
I have the following linear regression output with two quadratic terms and I am unsure how you make the general equation from this for predicting values for Y outside of R software. Any suggestions ...
0
votes
0answers
17 views
How calculate Multiple Linear Regression
I must write an application in C that calculates the Multiple Linear Regression but I have a doubt. Suppose to have
X The matrix is referred to as the design matrix. It contains information about ...
0
votes
0answers
33 views
Omnibus F test in MATLAB
I will to perform an Omnibus F test on the coefficients of a linear model. I want see if any of the coefficients are significantly non-zero. I do not have the original data to perform the linear ...
0
votes
0answers
8 views
Linear regression with dependent variable as part of independent variable
Linear regression with dependent variable as part of independent variable. The problem is that the independent variable is correlated with the dependent variable.
I have prediction problem. I have ...
0
votes
0answers
31 views
getting usable values from statsmodels WLS
I'm using statsmodels' weighted least squares regression, but getting some really huge values.
Here's my code:
X = ...
0
votes
0answers
53 views
Behavior of stepwise regression with both directions in R
Assume that I have the following scenario. My base formula is defined in the variable baseFormula
I start with a linear regression including all the variables
lm.fit <- lm(as.formula(formula)), ...
0
votes
0answers
48 views
How to find a linear regression of a ccdf graph in R
I have plotted a ccdf graph of some of my simulated power-law tail data and would like to find a best fit line from my ccdf graph. I used the code from the link ...
0
votes
0answers
28 views
Fitting a linear model where all coefficients are postive in R
How do I fit a linear model in R where all of the coefficients (not including the intercept) are positive?
0
votes
0answers
15 views
Linear Regression effect of data points on coefficients
I have data pairs (a1, b1)....(an, bn), where ai belongs to R is the ith data point and bi belongs to R is the associated target variable. Suppose I fit a linear regression model to
...
0
votes
0answers
14 views
How to use analytical test to check the importance of a column in a dataset?
I have a dataset like user_id | val1 | val2 | val3 and I would like to know how I can use analytical tests such as Anova or t-test to find the parameter/column that is the more important in the more ...
0
votes
0answers
27 views
Handling String Values in Regression
I am trying to perform Regression using Java and facing a huge difficulty in handling String values. As String values are not supported for Regression, I could not able to perform what I intended to ...
0
votes
0answers
47 views
Obtain coefficients of row wise linear regression
I have a large number of biological measurements (rows) for two treatments. I have identified some measurements with a similar and strong trend for increasing variance although they are not ...
0
votes
0answers
63 views
R Model Selection based on prediction accuracy
I am trying to decide which explanatory variables to use in my linear regression. My questioin is is there a package/function on R that:
Takes as inputs:
1) all the variables I think may ...
0
votes
0answers
30 views
SAS reading a file in long format
I have a file in long format, like so:
name weight month cal
bob 80 01 5000
ben 70 01 4989
mary 60 01 3000
bob 81 02 4999
ben 68 02 6000
mary 57 02 2800
...
I would like to create N linear ...
0
votes
0answers
42 views
Cateogrical variables and regression
I am trying to do regression with a categorical variable V with many (>200) levels. The only way to describe this variable is through the target vector T.
I would like to train my model to predict ...
0
votes
0answers
52 views
R: Bivariate linear model fitting (regression + ANOVA) for data in table with column 1 vs 5 other columns, individually
Precursor: I'm a beginner (but fast learning due to being assigned a project in R - having never used R before - don't ask)
First, the title question is only a tip of the iceberg. I have CSV data ...
0
votes
0answers
31 views
Model Representation - Linear Regression and k-nearest neighbours
Can anyone help me by explaining to me, in what kind of scenario/case whereby linear regression is suitable to produce a good predictive model for some given data. And in what kind of scenario/case ...
0
votes
0answers
33 views
Severe Multicollinearity: Time trend correlated with Real Icnome Per Capita
I am running some OLS regressions and I find that two of my regressors are highly correlated. These correlated variables are the time trend (starts at 1 and increase by 1 for every observation) and ...
0
votes
0answers
63 views
How to use mapreduce to do the linear regression for overlaps data
Here is my original code for doing all data using map-reduce. But how to split the data into different groups (each overlapping 252 days for a group) and then make linear regression for each group? ...