473,382 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

creating huge transition matrix

Hello every one ,

I am writing a code to generate huge transition matrix (2 order markov and one order markov)

here are my question :

1) is there any available source for efficiently generating mrrkov transition matrix ONLY ?
2) I have around 800000 nodes so what could be a better way to create such a huge structure ---> i am looking for access speed into an element in the transition matrix

Any suggestion about tools which might be more efficient .

Thanks in advance .

Regards
Dec 12 '11 #1
3 3104
Glenton
391 Expert 256MB
You definitely want to be using numpy and/or scipy for the matrix structures. Then the heavy lifting will be done in the background with C, and you can do array operations rather than loop operations.

Here's a link to someone who tackled this problem:
Large Markov Chains with Python
Dec 13 '11 #2
hi glen ton thanks for your suggestion,

Well i had a look into to NUMpy and SCIpy . I believe my requirement is more complex as i need 3 dimensional where the element in the 3rd dimension element might have to point 2 dimensional element in some cases.

I didn't understand by the " heavy lifting will be done by C" .. you r referring to numpy implementation ? or i need to implement it explicitly ?
Dec 30 '11 #3
Glenton
391 Expert 256MB
Hi. Numpy and Scipy were created to handle n-dimensional arrays so 3 is certainly not a problem. It's very similar to matlab (except better IMHO).

When you program in compiled languages like C or Java you get a huge performance benefit over higher level languages like python or perl. The flip side is that the actual coding is generally far simpler and more terse in python. Eg C may take 100th time to run but have triple the lines of code.

Also handling things like graphing, files, user interface and other scripting functions is far simpler in a high level language. Thus they often work quite well together. However numpy captures a great deal of this benefit *invisibly* to the coder. If you know how to use it you can capture even more benefit, Eg by using array functions instead of looping through the array.

However if that's not useful you could just use lists of lists of lists.
Dec 30 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Ivan Voras | last post by:
Is there a nice(r) way of creating a list of uniform values? I'm currently using: list('0'*N), which makes a string and then chops it up into a list. I need it to create a NxN matrix: matrix = ...
3
by: Darleen | last post by:
I am seeking conceptual here on how to get started with a "3D Matrix" in Access. We run a training center which holds multiple classes in multiple cities at multiple times. So I need to create a...
2
by: luke.yolanda | last post by:
Hi everyone Now i'm designing a random instances generator for maximum clique problem using C. So I planing to implement a adjacent matrix in this generator to store the whole graph going to be...
14
by: Gale | last post by:
I wrote a simple script for image rotation. now i need to have some transition effect betwean images in JS What do you suggest ? Thank you
15
by: luke.yolanda | last post by:
hi everyone I have a question. First, I have implemented a huge matrix in a program, like 'unsigned char matrix;', when I executed this program, the error occured. Then I modified the ...
38
by: djhulme | last post by:
Hi, I'm using GCC. Please could you tell me, what is the maximum number of array elements that I can create in C, i.e. char* anArray = (char*) calloc( ??MAX?? , sizeof(char) ) ; I've...
20
by: Frank-O | last post by:
Hi , Recently I have been commited to the task of "translating" some complex statistical algorithms from Matlab to C++. The goal is to be three times as fast as matlab ( the latest) . I've...
7
by: VijaKhara | last post by:
Hi all, Is there any method which can implememt the matrix multiplication faster than using the formula as we often do by hand? I am writing the following code and my matrice: one is 3x40000 and...
2
by: Zhengzheng Pan | last post by:
Hi all, I'm trying to check whether a (stochastic/transition) matrix converges, i.e. a function/method that will return True if the input matrix sequence shows convergence and False otherwise....
4
by: kayjay66 | last post by:
hello! MY CODE IS RUNNING AND IT'S ALL FINE, I ONLY NEED TO KNOW HOW TO MODIFY IT AND MAKE IT RUN ON A CORE 2 DUO INTEL CENTRINO. i have written 2 programs, the first one is only for creating...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.