least-squares

Least squares in a set of equations with optimize.leastsq() (Python)

陌路散爱 提交于 2021-02-09 15:49:04
问题 I have two functions and a set of data. Both functions have the same x data and the same parameters. I want to obtain the parameters by least squares method that makes the best fit of my data. The parameters are: ex,ey,ez. The X data are: RA,DE (like 3000 points). The Y data are: dRA,dDE. I tried this but I obtained a wrong solution: def residuals(p, dRA, dDE, RA, DEC): ex,ey,ez = p f1 = dRA-(ex*sin(DEC)*cos(RA)+ey*sin(DEC)*sin(RA)-ez*cos(DEC)) f2 = dDE-(-ex*sin(RA)+ey*cos(RA)) err = np

Least squares in a set of equations with optimize.leastsq() (Python)

人盡茶涼 提交于 2021-02-09 15:46:38
问题 I have two functions and a set of data. Both functions have the same x data and the same parameters. I want to obtain the parameters by least squares method that makes the best fit of my data. The parameters are: ex,ey,ez. The X data are: RA,DE (like 3000 points). The Y data are: dRA,dDE. I tried this but I obtained a wrong solution: def residuals(p, dRA, dDE, RA, DEC): ex,ey,ez = p f1 = dRA-(ex*sin(DEC)*cos(RA)+ey*sin(DEC)*sin(RA)-ez*cos(DEC)) f2 = dDE-(-ex*sin(RA)+ey*cos(RA)) err = np

Least square method in python?

别等时光非礼了梦想. 提交于 2021-02-07 07:30:39
问题 I have these values: T_values = (222, 284, 308.5, 333, 358, 411, 477, 518, 880, 1080, 1259) (x values) C/(3Nk)_values = (0.1282, 0.2308, 0.2650, 0.3120 , 0.3547, 0.4530, 0.5556, 0.6154, 0.8932, 0.9103, 0.9316) (y values) I know they follow the model: C/(3Nk)=(h*w/(k*T))**2*(exp(h*w/(k*T)))/(exp(h*w/(k*T)-1))**2 I also know that k=1.38*10**(-23) and h=6.626*10**(-34) . I have to find the w that best describes the measurement data. I'd like to solve this using the least square method in python,

Moving least squares fitting for point displacements having issues

冷暖自知 提交于 2021-01-05 08:54:15
问题 Explanation of the problem: I have points with (x,y,z) coordinates at two+ distinct times. For convenience, they can be imagined as irregularly spaced points along the surface of an inverted paraboloid. There is some minimal thickness to the paraboloid. The paraboloid changes shape slightly as time proceeds (like a balloon inflating) and when it does so, all of the points move. By substracting the coordinates at time2 - time1, I can get the displacement vectors at each point. It is important

Moving least squares fitting for point displacements having issues

孤人 提交于 2021-01-05 08:53:39
问题 Explanation of the problem: I have points with (x,y,z) coordinates at two+ distinct times. For convenience, they can be imagined as irregularly spaced points along the surface of an inverted paraboloid. There is some minimal thickness to the paraboloid. The paraboloid changes shape slightly as time proceeds (like a balloon inflating) and when it does so, all of the points move. By substracting the coordinates at time2 - time1, I can get the displacement vectors at each point. It is important

Ceres Solver: unable to disable logging (google glog)

不羁岁月 提交于 2021-01-02 06:14:31
问题 I'm using ceres solver for a project, and when I call the ceres::Solve function, the library starts to output lines such as this one: iterative_schur_complement_solver.cc:88 No parameter blocks left in the schur complement. wall_time.cc:74 IterativeSchurComplementSolver::Solve Delta Cumulative Total : 0.00001 0.00001 I tried to disable the logging of these intermediate steps but I had no success so far. I'm calling this line on the constructor of my class: google::InitGoogleLogging("my

Ceres Solver: unable to disable logging (google glog)

戏子无情 提交于 2021-01-02 06:13:39
问题 I'm using ceres solver for a project, and when I call the ceres::Solve function, the library starts to output lines such as this one: iterative_schur_complement_solver.cc:88 No parameter blocks left in the schur complement. wall_time.cc:74 IterativeSchurComplementSolver::Solve Delta Cumulative Total : 0.00001 0.00001 I tried to disable the logging of these intermediate steps but I had no success so far. I'm calling this line on the constructor of my class: google::InitGoogleLogging("my