473,789 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

data fitting with php

Hi php pros,

I have an array containing n numbers and want to fit them to e.g. a
polynomial function f(x), x=1...n.

Is there a php script / library for doing that?

I basically wish to do curve fitting to my data array, directly in
php.

Ideal would be something like polyfit in MatLab.
One possibility would be to involve a c++ program doing the data
fitting. Export the array as a dump file from php, execute the
compiled c++ polynomial fitting file program calling the dump file and
saving the result, and then open the result file in php. Thats of
course not so elegant ...

Thanks for any help.

Best

-saudepp

Sep 6 '07 #1
1 3129
On Sep 6, 4:01 pm, "saud...@google mail.com" <saud...@google mail.com>
wrote:
Hi php pros,

I have an array containing n numbers and want to fit them to e.g. a
polynomial function f(x), x=1...n.

Is there a php script / library for doing that?

I basically wish to do curve fitting to my data array, directly in
php.

Ideal would be something like polyfit in MatLab.
One possibility would be to involve a c++ program doing the data
fitting. Export the array as a dump file from php, execute the
compiled c++ polynomial fitting file program calling the dump file and
saving the result, and then open the result file in php. Thats of
course not so elegant ...

Thanks for any help.

Best

-saudepp
there are COM objects (sold) which you can invoke from within PHP,
other than that, writing your own spline model seems a challenge just
to avoid the inelegance of using an existing c++ program.
dont reinvent the wheel eh!
by f(x) do you mean a cubic polynomial?

Sep 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1406
by: Grant Edwards | last post by:
I'm looking for a surface fitting library for Python. Something like the least-squares module in scientific python, except I want to fit a surface (z = f(x,y)) instead of a curve (y = f(x)). I found a couple other curve fitting libraries (some are wrappers to C/Fortran libs I don't have), and I found a curve and surface-fitting web page (www.zuzun.com) that's written in Python -- I found a couple postings by James R.
6
6634
by: Ron Kneusel | last post by:
Is there a python package out there that supports fitting a set of 2D points to an ellipse? I haven't been able to find one. Thanks! Ron
4
2418
by: Roy Smith | last post by:
In the recent "transforming a list into a string" thread, we've been discussing the fact that list.pop() is O(1), but list.pop(0) is O(n). I decided to do a little timing experiment. To be sure, I did verify experimentally the expected result, but along the way, I came upon an interesting artifact that I'm at a loss to explain. I used the following to generate some timing numbers for pop() on various sized lists: import time
2
3217
by: Grant Edwards | last post by:
I've been looking for some way to approximate scattered 3D data points in Python. The data doesn't seem to be amenable to fitting functions like polymials, so I may have to use something more like a spline surface. However, I can't find anything usable from Python, and my Fortram skills are pretty rusty. I tried SciPy, but it's spline fitting module doesn't work at all for my data. I've found mentions of a Python port NURBS toolbox,...
1
2438
by: Mahesh | last post by:
Hi, I need a javascript code for fitting the background image to the window. Help will be appreciated. Thanks, Mahesh
2
6879
by: Niraj | last post by:
Hi, I am trying to do bulk insert of binary data (array of bytes) in an Oracle table. The data type of the table is BLOB. I am using Oracle Objects for OLE (OO4O) in C++. The binary data that I have to insert is in the form of byte array. My problem is that the bulk inserts happen only as long as the length of array is less than 4K. Any data more than 4K gets truncated. Is it possible to do bulk inserts in a BLOB field with data more...
3
1952
by: narasimha | last post by:
Hello, I have a data record with two fields...<value, date>. I have more than a million of these records. As I add more records into this set, I want a data structure that would be efficient enough to find duplicate records with the same value, and earliest possible date. It should be efficient to insert the records into the data structure. Is there any database structure that I can get help with ?? -Narasimha
3
3572
by: To Forum | last post by:
hi, i am looking for a library in C++ which enables me to fit a function to a set of data...ideally in pure STL C++... Please share your insight on the subject. my thanks TF
4
5231
by: Evelien | last post by:
Dear python-users, I am trying to do a non-linear least squares fitting. Maybe trying is not the best word, as I already succeeded in that. At the moment I am using leastSquaresFit from Scientific Python. I know of other least squares routines, such as the one in scipy.optimize and I believe there is also one in numpy. Now here is my question: in my search for a good algorithm, I was not able to find any non-linear least squares fitting...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.