Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Regression with custom interception#1080

Answeredbydiluculo
JP-Reis asked this question inQ&A
Discussion options

Hello community,

I have been trying to figure out how to obtain the regression equation for a linear regression model with a pre-defined intercept value with no success.

The customer want to replicate some of the Excel functionalities that they are used to use in Excel. Is this even possible in with this lib?

Thank you.

You must be logged in to vote

You can applyy - 3.0 to theFitThroughOrigin function to model the equation with an intercept of 3 on the y-axis.

Replies: 2 comments 4 replies

Comment options

I know that there is a built-in function to FitThroughOrigin, but what if I want to model the equation to intercept (a=xyz) on Y=3?

You must be logged in to vote
0 replies
Comment options

You can applyy - 3.0 to theFitThroughOrigin function to model the equation with an intercept of 3 on the y-axis.

You must be logged in to vote
4 replies
@JP-Reis
Comment options

Ok, so far that seems to do the trick!

Is there any similar function asFitThroughOrigin for exponential and polynomial models?

@diluculo
Comment options

var slope = FitThroughOrigin(x, y.Select(p => p - 3.0).ToArray())

@diluculo
Comment options

Please seemathnet-numerics/src/Numerics/Fit.cs.

For general models, nonlinear least square fitting (Levenberg-Marquardt) or other optimization methods can be used. Please see the test cases inmathnet-numerics/src/Numerics.Tests/OptimizationTests.

@JP-Reis
Comment options

I'll give it a look. Thank you.

Answer selected byJP-Reis
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@JP-Reis@diluculo

[8]ページ先頭

©2009-2025 Movatter.jp