Math'ca - Can't get a function to read in data

  • Thread starter Thread starter TopCat
  • Start date Start date
  • Tags Tags
    Data Function
Click For Summary
SUMMARY

The forum discussion addresses a solution for performing maximum likelihood estimation using Mathematica with multi-dimensional data. The user encountered issues when trying to evaluate a 2D function, P[x,y], with data formatted as a list of pairs. The solution involved remapping the function using the Apply function to convert list elements into function arguments, allowing the maximum likelihood function to process the data correctly. The final implementation utilized the MapAll function to iterate over the data effectively.

PREREQUISITES
  • Familiarity with Mathematica programming language
  • Understanding of maximum likelihood estimation concepts
  • Knowledge of 2D functions and their evaluation
  • Experience with list manipulation functions in Mathematica, such as Apply and MapAll
NEXT STEPS
  • Explore advanced Mathematica functions for data manipulation
  • Learn about maximum likelihood estimation in depth
  • Investigate the use of Apply and Map functions in Mathematica
  • Study examples of multi-dimensional data processing in Mathematica
USEFUL FOR

Data scientists, statisticians, and Mathematica users who are working with multi-dimensional datasets and require efficient methods for function evaluation and maximum likelihood estimation.

TopCat
Messages
55
Reaction score
0
SOLVED - Math'ca - Can't get a function to read in data

I'm trying to do a maximum likelihood estimation in Mathematica. My data was in a text file and I read it into a table. Each entry in the table is two values, like {{1,2},{3,4},...}. I have a 2D function, P[x,y] and when I try and evaluate at a data point, P[data[[1]]], for instance, it doesn't input the values. It just returns P[{1,2}] (with the data in this example).

Now, it works fine when the data and function are one-dimensional. So this tells me the data is not stored in a manner that the function can immediately use. The problem here is that for me to use the Max Likelihood function, I need the data to be in the proper format. The arguments for the ML function are ML[data,f,param], so it needs to enter the data into the function. So, is there a way I can make a table or list of {x,y} data that could possibly work in this scenario?

As an aside, there must be because an example of this ML uses multi valued data. I can't get it work with mine though. Argh!

Thanks thank thanks to anyone who can help!
 
Last edited:
Physics news on Phys.org
Okay, I managed to figure this one out, and get a bit of Mathematica skill in the process.

If P is my Poisson function, I had to remap it into another function like so:

i = MapAll[Function[w, Apply[P, w]], #] &;

where w is a place holder variable, Apply is a math'ca function that turns list elements into function arguments, and MapAll applies every subpart of the list element to the function. Now my function can crawl over all of the data in a table, or accept a single element as input.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K