Linear regression calculation

Need to know whether an algorithm to calculate linear regressions exist, given a determined number of points.

Dear Ingo,
I am not sure about your answer. Well, I need an script as a solution. Imagine, the time data is collected in a channel, DatCha_1. There are 1000 points corresponding to 10 seconds. I have the corresponding aceleration data, in Dat_Cha_2, that is, 1000 acceleration points. So, I need to calculate the linear regression with this acceleration data each second, that is, I must obtain the a, b data of a y=a+bx  corresponding to each 100 values of the acceleration data, so 10 a values and 10 b values. I must divide the original acceleration data into 10 interval and obtain the linear regresion of each of this intervals.
What should be the script for this action? You mention to adjust the channel length of the time and data channel, but I do not know what you mean. In fact the function is:
Call CHNREGRYCALC("Time","Acceleration","Time","Regress_Y","linear") '... X,Y,XCHNNO,E,REGRTYPE
Could I use a new time channel only with 10 values and the original aceleration with 1000 values?
So, please could you send me a little example of the script I would need to solve the problem?
Regards,
Koniker

Similar Messages

  • Linear regression

    Hi,
    I would like to know how I could do the following linear regression calculation.  I have two data channels, the first one corresponding to time information and the second one about aceleration. I must do linear regression with this acceleration data each second, but taking into account that the time channel has 10585 points for example for 44.1 seconds, corresponding to a 240msec sampling frecuency. I suppose that I must use the ChnRegrXYCalc function but I would like to know what the parameters should be.
    REgards
    Koniker.

    Dear Ingo,
    I am not sure about your answer. Well, I need an script as a solution. Imagine, the time data is collected in a channel, DatCha_1. There are 1000 points corresponding to 10 seconds. I have the corresponding aceleration data, in Dat_Cha_2, that is, 1000 acceleration points. So, I need to calculate the linear regression with this acceleration data each second, that is, I must obtain the a, b data of a y=a+bx  corresponding to each 100 values of the acceleration data, so 10 a values and 10 b values. I must divide the original acceleration data into 10 interval and obtain the linear regresion of each of this intervals.
    What should be the script for this action? You mention to adjust the channel length of the time and data channel, but I do not know what you mean. In fact the function is:
    Call CHNREGRYCALC("Time","Acceleration","Time","Regress_Y","linear") '... X,Y,XCHNNO,E,REGRTYPE
    Could I use a new time channel only with 10 values and the original aceleration with 1000 values?
    So, please could you send me a little example of the script I would need to solve the problem?
    Regards,
    Koniker

  • Calculating linear regression with DAX in a Tabular model

    Hi,
    I'm interesting to know if anyone has faced the linear regression in a Tabular model by DAX formulas.
    Thanks

    It's been a while, but... recently Rob Collie did a blog post about this
    here.

  • Crystal Reports Linear Regression Trendline Slope

    I need to know the slope of my linear regression trendline from my chart to determine whether the trend is positive or negative. I can't find any information on how to display and/or use that value in a formula.

    It appears that the steps I was taking was incorrect.  To actually get the trendline, you need to click the line in the line chart that you want the trendline to be against.  Follow the steps above BUT do not start it from the legend.

  • Using Multiple Linear Regression from SAP Predictive Analysis within S&OP

    How could I go about using a model exported from SAP Predictive Analysis, say a multiple linear regression model, as a stored procedure in HANA from within S&OP?

    Hi Kevin,
    You cannot use a model exported from SAP Predictive Analysis in S&OP.  S&OP uses the same PAL libraries from HANA for Statistical Forecasting. We enable a few statistical forecasting methods from PAL like exponential smoothing from S&OP.
    Thanks,
    Raghav

  • Seasonal linear regression

    Hi there, APO Guru's
    We have created a forecast profile that uses strategy 35.
    However when we run the forecast with this model for say the last 36months of history. The system proposes an almost straight line forecast. If we run it with 18 months history then the system proposes an acceptable forecast. I can now clearly see the sales history pattern in my forecast.
    We do have enough data and seasonality in our history for the 36 months to work.
    Can anyone maybe shed some light on this.
    We also recently upgraded to SCM 5.0
    Thanks for your assistance
    Robert

    Before the system applies seasonal linear regression, it carries out a seasonal test. The system uses this test to check if the historical data contains any seasonal patterns. For this, the system determines the autocorrelation coefficient for all periods.
    If the value determined is at least 0.3, the system applies seasonal linear regression. If the value is less than 0.3, the system does not recognise a seasonal pattern and applies linear regression.
    So I think the test against your 36 months of data returns a value of less than 0.3 and hence it uses linear only, and the value for your 18 months seems to be greater than 0.3.
    (P.S. You can change this limit in the /SAPAPO/SCM_FCSTPARA BAdI – Method PARAMETER_SET)

  • Graphing Linear Regression With JFreeChart

    Hi everybody I'm making a school project where I need to graph linear regression and scatter diagram in the same graphic, I am using JFreeChart and is a little confusing, I have already made a basic graph but I want to know if someone can tell me how to draw the line for the regression, i have de the values of a, b [bx + a], and also how to make the thickness of the line more thin...Here is my code any ideas are welcome :D
            JFrame frm_grafica = new JFrame("Grafica - B-Rabbit");       
            frm_grafica.setVisible(true);
            frm_grafica.setSize(250, 250);
            frm_grafica.setLocation(this.getLocation().x+this.getWidth()+5, this.getLocation().y);               
            XYSeries serie1 = new XYSeries("Diagrama de Dispersion");
            XYSeries serie2 = new XYSeries("Regresion Lineal");
            for(int i = 0; i < limitRows; i++){
                serie1.add(matriz[0], matriz[i][1]);
    for(double i = 0; i <= limitRows; i+=0.1){
    serie2.add(i, b*i+a);
    XYSeriesCollection datasetCollection = new XYSeriesCollection();
    datasetCollection.addSeries(serie1);
    XYSeriesCollection datasetCollection2 = new XYSeriesCollection();
    datasetCollection.addSeries(serie2);
    XYDataset dataset = datasetCollection;
    XYDataset dataset2 = datasetCollection2;
    JFreeChart chart = ChartFactory.createScatterPlot(
    "Diagrama de Dispersion",
    "X",
    "Y",
    dataset,
    PlotOrientation.VERTICAL,
    false,
    true,
    false
    XYPlot plot = (XYPlot)chart.getXYPlot();
    plot.setDataset(1, dataset2);
    XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
    renderer.setSeriesShapesVisible(0, true);
    renderer.setSeriesShapesFilled(0, true);
    NumberAxis rangeAxis = (NumberAxis)plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createStandardTickUnits());
    ChartPanel chartPanel = new ChartPanel(chart);
    frm_grafica.add(chartPanel);
    chartPanel.setVisible(true);

    I think I have an idea as to what to do.  I still need to retain the integrity of the original data, therefore I will be creating new channels. 
    In a script you could do a loop looking for a value that is within the range then copy that data set to the new channel.  Are there any builtin commands that would make this process quicker or more streamlined?  All I know to do is to look at each value with CHD and make the decision from there. 
    Thanks,
    Wayne

  • 50G / simultaneous multiple scatter plots + intersection of linear regression lines

    I have a real specific problem with scatter plots and linear regression lines.
    First, I've been looking over the manual and the internet trying to figure out how to graph multiple scatter plots at the same time, but it seems like you can only do Columns 1 and 2 or Columns 1 and 3, etc., from Edat (greek letter), you can't do all three columns at once IF Column 1 represents X and 2 and 3 represent Y-values.  Or columns 1 & 2 as one set, and 3 & 4 as a second set. 
    Further, because it doesn't seem to be able to do this, I can't get it to find the intersection of these two lines. I can get the x-intercept and y-intercept just fine but I don't need that. What I can do is do a linear regression on both sets of data to get an equation for a line, put it into an array, and use the solver on it, that does indeed work. But that's a whole lot of extra keypresses just to get an ordered pair. I have experience on TI and Casio calculators and they don't have this seeming limitation. 
    Any suggestions?

    I have a real specific problem with scatter plots and linear regression lines.
    First, I've been looking over the manual and the internet trying to figure out how to graph multiple scatter plots at the same time, but it seems like you can only do Columns 1 and 2 or Columns 1 and 3, etc., from Edat (greek letter), you can't do all three columns at once IF Column 1 represents X and 2 and 3 represent Y-values.  Or columns 1 & 2 as one set, and 3 & 4 as a second set. 
    Further, because it doesn't seem to be able to do this, I can't get it to find the intersection of these two lines. I can get the x-intercept and y-intercept just fine but I don't need that. What I can do is do a linear regression on both sets of data to get an equation for a line, put it into an array, and use the solver on it, that does indeed work. But that's a whole lot of extra keypresses just to get an ordered pair. I have experience on TI and Casio calculators and they don't have this seeming limitation. 
    Any suggestions?

  • How to create a linear regression line series

    I am relatively new to Flex and I am currently working with charts in the data visualization components. It has been requested that I add a linear trendline (ie, linear regression trend line) to a column chart. From what I can tell, there is no linear regression form for the mx:LineSeries. Has anyone created a linear trendline using the data visualization components in Flex, or does anyone have any suggestions on how to accomplish this?

    Nicholas @ Bime posted a solution to this sort of problem earlier this year, apparently. He created a custom component that extends the CartesianDataCanvas, and can be called as an annotation element of the chart. See the following url: http://bimehq.com/data-visualization/introducing-flex-charting-trend-line-component/
    His solution works very well, with the only caveat being if you have mutiple series on your chart, all the trendlines will be the same color, and there is no label on the lines to show which line corresponds to which series.

  • How can I make a graphic (scatter chart) with 1 "y", but multiple "x" (to make a multiple linear regression)?

    how can I make a graphic (scatter chart) with 1 "y", but multiple "x" (to make a multiple linear regression)?

    Émilie,
    The default for X-Y Charts is for X values not to be shared, so it's entirely possible for you to create X-Y pair sets that have common Y-values and independent X-values.
    This answer assumes, as always, that I properly interpreted your problem statement. A linear fit line for each pair set should satisfy.
    Jerry

  • Linear regression library?

    I have to do some linear regressions and get the residual.
    Do you know any library that calculates linear regressions?

    Can't recommend any from use, but there's a big list of java numerical libraries at http://math.nist.gov/javanumerics/
    Though numeric java isn't as trendy as it was ten years ago, and many non-business numerics haven't been maintained (possibly since Python and other languages has better support for foreign calls to script existing libraries, rather than Java requiring you re-write everything as Java)

  • Linear Regression - How to view t-statistic and p-value

    How can we view the t-statistic and p-value for the predictors in a linear regression or multiple linear regression model?

    The R code sample for LM would be as follows: model <- lm(dependent_var ~ independent_var, data=data.set)
    In the Azure ML gallery there are a few samples which can help you get set up with the experiment. (Sample name: Exploring the Usage of R in AML)

  • Linear regression correlation coefficient

    Does anyone have a vi that computes the linear regression correlation coefficient (R^2)?

    gbaby wrote:
    I know this thread is ten years old but I'm still going to post the subVI i made, it will work even for those with the base development package. Hope this proves useful for somebody out there.
    Thanks! Actually, looks very similar to the one posted by greg over 10 years ago.
    You can eliminate the FOR loops (might perform better by taking better advantage of SSE). After the FOR loops are removed, there are a few common sub-expressions that you can merge for even better performance. No big deal, though.
    LabVIEW Champion . Do more with less code and in less time .

  • Linear Regression or Curve Fitting?

    Hi,
    I would like to perform linear regression operation over some data that I have collected during test. What is the difference between linear regression and curve fitting? Can I use curve fitting VIs available to perform linear regression? If no, where can I find VIs or information regarding linear regression in the LabVIEW 6i?
    Thank you for your help. It will save me many hours of search.

    there are some very good examples in the examples directory of LV. C:\Program Files\National Instruments\LabVIEW 6\examples\Analysis\regressn.llb\Regressions Demo for example. You must have a LabVIEW full development system.
    Stu

  • Linear Regression - set intercept = 0?

    Using a linear regression, is there a way to set the intercept to zero?

    This annoyed me for a short while when I first started using Diadem.
    Instead of trying to run a linear regression, you can use non linear curve fitting and change your setup function formula from a+b*x to simply b*x (or similar). This ensures that your fit intercept is 0.
    CLD

Maybe you are looking for

  • Can't install adobe flash player

    i am not a techie, so the previous threads dont help me much -- not basic enough, i guess.   anyway, i cant seem to install adobe flash player.   i often click on a website or something, and it wont run because it says i need adobe flash player (had

  • Acrobat form with server side submit, posting blank data

    Read more Acrobat form with server side submit, posting blank data, thanh xả tràn I have a PDF form which gets submitted to the server using a submit (server-side) button. The data is then received in XML format by a ColdFusion component which does s

  • Connecting to another computer

    We will be moving out of our house for a month or two and would like to connect our computer to our in-laws computer via the wireless router.  Is this possible?  In-laws have DSL (as do we) but the main computer in there home is just hooked up to the

  • TS3212 Why does insufficient permissions pop-up when I'm trying to download itunes?

    When I try to download Itunes this message appears in the download box

  • Arrange An Entire External HDD

    Is there anyway to set Finder to arrange and sort all folders the same  way on an entire external drive? I have many different archive files  on an external drive that I would like to arrange by type and sort by  name. The only problem is, the only w