Let your heart guide you......It whispers so listen closely

Thursday, December 27, 2012

parts of past

Met an old friend today.. she is more like a younger sister. Till like 2 years back, I had spent considerable time with her. We used to chat a lot, share tit bits.. with time it didn't remain much. Today when I met, I felt so light and good, we again chatted endlessly. And it reminded me of the past... 

There are so many layers of it. While coming back, some how I floated into the deeper past. There were so many things, so many people, so many expressions. I feel excited, embarrassed,  nostalgic.. everything at the same time. I was almost watching my past as a movie. I was riding, there was traffic on the road, but simultaneously there was jam in the mind, thoughts from the past were pushing each other to overtake and come to the front line. There were moments which were clear as crystal.. I could hear/read the exact sentences, see the expressions on the faces of people.. but then, also there were moments which were hidden in fog.. it was hard to recall what was actual course.. how things actually happened. There were friends, relations, blogs, posts, messages, emails, walks, songs, drawings.. I miss parts of them. I want to delete parts of them. That time.. it was good.. it was bad. But I am somehow missing it badly at this moment. As if it was a dear friend of mine. Might not be the perfect but close to heart. I want to hang around with it, for some more time. I am alone and I feel it wants to give me company.

चलो ना शोर में  बैठें, जहाँ कुछ न सुनाई दे
कि  इस ख़ामोशी में तो सोच भी बजती है कानों में


PS: There is a sudden rush of feelings. I don't wanna loose it as always. So just wrote whatever came  to my mind, without bothering the grammar or logic. But this is first time that I am unable to feel lighter, even after writing.

Post PS (added on December 28, 2012 - 2:40 PM): Those lines in Hindi are part of a त्रिवेणी  by Gulzar.

Monday, October 8, 2012

organised randomness

Once again, long time since I wrote. But this time I was really really busy. I think now I am actually working ;) But surfing can never be stopped. In the meanwhile I read many things which I felt would be of interest to some of you, so i kept on collecting them. I know its too creepy to read a post full of hyperlinks. But that is how this one is gonna be.

> Scientific Methods of catching a lion. This started when we came across new techniques of Big Game Hunting. Horward Eves, in his book on Mathematical stories & anecdotes talks about many such interesting methods, which got place in American Mathematical Monthly; and not even this, book also notes the events which led to the facetious contribution. Here is one of those methods: 
"THE METHOD OF INVERSIVE GEOMETRY. We place a spherical cage in the desert, enter it, and lock it. We perform an inversion with respect to the cage. The lion is then in the interior of the cage, and we
are outside." - Mathematical Circles Revisited: A Second Collection of Mathematical Stories and Anecdotes (Page - 77).

> Here comes the actual reason for the title of this post. With the advancement of science, to be more precise statistics and computing, the time has come when one can randomly generate English sentences, which almost make sense. Here is a statistician sharing his R code. Story doesn't end here. People have developed softwares where one can generate research papers, grant proposals and what not. And things make so much sense that such stuff was published and read in conferences. If you are still far from surprise, look at this. There is somebody around the corner, who is generating RANDOM theorems and giving proofs to them.

> A Most Unusual Bird -  Statistical adaptation of the Raven (a poem by E.A. Poe). Very interesting modification of the famous poem, bringing in Statisticians and Statistical theories.  This one was passed on by ASK. 

> A Komplexified website. This website is all about mathematics and humor  The best stuff I found here was  interpretation of the commonly used phrases in mathematical literature and different varieties of proofs. There were also some funny one-liners and quotes.


Thats all about the not-so-serious stuff.  Here are some chunks of serious news:

> This year on teachers' day, the Statistics department of Presidency University, Kolkata organized a special programme to felicitate the three living legends of statistics Gun-Gupta-Dasgupta. So does something click in your mind after reading these names. They are well known for their book Fundamentals of Statistics, which we used to read in our B.Sc. For reasons, which are not so clear to me, I felt very excited after reading this piece of news. What a great way to celebrate the day.

> On 12th August  we attended a memorable ceremony, where a commemorative blue plaque was placed on Dr. P. V. Sukhatme's residence. We had a really great time listening to incidences related to Dr. Sukhatme by Dr. J.V. Deshpande and Dr. Suhas Sukhatme. You may find the details of the event at ASK's post. 


PS: As always.. hoping to come back soon :)

Thursday, August 30, 2012

parallel computing in R

I don't know what would have happened to me and my research if I didn't knew R. It has always been the most co-operative tool. But  RBM was never happy with the speed of programs, specially when I am doing simulations etc. So, one fine day I started googling, the ways to speed up the programs. I invested one complete day and got decent increase in speed. I was very happy and excited that I actually managed something cool; but next day his reactions made me realise that it is not sufficient. 
This led to following two consequences:
i) I was kind of disheartened; so neither I tried going in to greater depth nor did I try formulating and recording the procedure, at least for my record.
ii) I started looking into package making in R (which he always wanted me to do). In last 2 years I have tried doing that at least 2-3 times, but always gave up. But to my surprise, this time I managed within a day (will share that too, soon).

So there I was.. Within 2 days, I had successfully managed implementing 2 reasonably clumsy techniques. But my laziness never allowed me to go ahead with it.

It was only when MGK poked me, I realised that I cannot recall any of it. I didn't knew which files to look into. But eventually I managed. Thanks to ASK, who helped me in reviving. Before I forget again, I made a point to re-search, re-view and document...

Few important notes:
> I have used Revolution R Community 6.0 . One can also try with other versions of R like R 2.15.1, but then you need to make sure if all the required libraries/packages are downloaded/installed. Revolution R has got all of them.

> The version of parallel computing I have used, employs the notion of foreach (a replacement for standard "for statement"). It says "do this to everything in this set", rather than "do this x times".

> We have to register a parallel backend, otherwise foreach will execute tasks sequentially.

> %dopar% executes the R expression using the currently registered backend.

So here is a sample code:

# packages that have to be loaded
library(parallel)
library(foreach)
library(iterators)
library(doParallel)

# to detect the number of CPU cores on the current host
detectCores()  

# 
Creates a set of copies (say 2) of R running in parallel
cl = makeCluster(2) 

# registers the parallel backend with the ‘foreach’ package
registerDoParallel(cl)

# to check if the multiple core is registered. If not, a warning will be issued that it is running sequentially. However, warning is issued only once
z=foreach(i=1:10)%dopar% 
{  sample(c("H", "T"), 10000, replace=TRUE)
}

# returns the number of execution workers in the currently registered doPar backend; should be same as input to makeCluster
getDoParWorkers()

# sample code
x=foreach(i=1:T,.combine='+')%dopar%
{    # a function which has to be executed T times
     vec=vecofderiv(N,M,orgtpm,orgtP)               
     I=vec%*%t(vec)
}
# x contains the sum of expression, on the last line of the loop (since argument to .combine is '+'). Here x is sum of I’s.

Some more notes:
 >   I am not sure, but my experimentation indicated that it is sufficient to register as many parallel backends as is the number of cores available. There was no improvement if I tried registering more backends than available no. of cores

>  Other arguments to .combine could be 'cbind', 'c', or some user defined function (not very sure about the usage). 

> Since the execution is parallel, make sure that the tasks are not related or dependent.

> This is not the only option available. Though I had to stick to this one as I was not able to exactly understand how to bring others to work, like doSNOW, which is a parallel adapter for SNOW (Simple Network of Workstations) package.  There were few which were not available for Windows, like doMC, which is a parallel adaptor for the multicore package. 


PS-1. Thanks are due to the authors of all the R help files I looked into; and offcourse the R team.
PS-2. Please post your valuable comments, so that we can get a better insight of the procedure.

Post PS: Hope to get back soon, with something light and random ;)

Tuesday, August 21, 2012

मैं हारी, जा-जा री ..

Few days back, some how I stumbled across the movie Khubsoorat. I had watched it long time back and had liked it for many reasons.. one of them is Kaffila-making (probably by Gulzar). All in all its a movie which can make you smile anytime. I had never realised before that this movie is by Hrishikesh Mukherjee. I have always been fan of his movies like Chupke-Chupke, Golmaal, Bawarchi ..now i have another one to add. All of them are comedy in such a homely and warm manner, that a person like me keeps on revisiting them. 

By the way its not the only reason.. for this post and the title. When I revisited Khubsoorat, I noticed the song Piya Bawri, which I overlooked when I saw it for the first time; probably i was too immature back then, to notice such master pieces (planning to come up with some more, which I went crazy for). 
It is a beautiful song written by Gulzar. But what made it more special was the classical part sung by Ashok Kumar in the starting. I was familiar with Rail Gaddi, but I never expected something like this. 

I have no knowledge of classical music, but I went totally gaga over it. I think sometimes it is possible to love something without knowing the science behind it.

Just a 2 min clip with that special part ..


I haven't posted the full song, since its available everywhere. The starting part is not included in the song ANYWHERE, its only there in the movie.. 

Enjoy :)

PS:1. @ MGK & ASK - I know something else was expected today; but some more re-search & re-vision of the facts is required. So will be there with it soon ;)
PS:2. @ Those who are stiill wondering about the title - You got to listen the clip.

Friday, August 17, 2012

stopped writing OR not been writing !!!!

I accept that I have not been writing lately; but one (and everyone) should note that it is NOT same as i have stopped writing. I was really furious and agitated after reading that remark. I don't know why, but it hurt me. It felt like I have been kicked out of the community :-| It is just 115 days since I wrote here. I know that makes almost 1/3rd of an year; but I was actually busy. Just like those, who think that I have stopped writing, all this while even in my mind dozens of post were written and deleted. I had almost formulated so many of them. But somehow, i could never open blogger. Yes I accept, there is no pending/incomplete post waiting to get published. I never picked up the pen, or better way, never tapped my fingers on key board.

There are so many things which were worth sharing, but which lost their importance or my enthusiasm to write now. Since today morning I was so sure that I have to write now, no matter what blah comes out.

Now since I am already back since last 5 minutes I can't resist doing the random babble. Those who are sensitive to noise may please use cotton plugs (or equivalently close this tab).

Around a month back, I almost got a strong feeling (which stayed for around a week) to make my blog private and do all the random not-so-good babble in it.. so that i don't have to answer any questions about what I have written. But the best part of my busy-ness (or rather lazinees) was not even opening the blogger to make it private, forget about writing posts :P

Right now so many random things are circling my mind

> Have been watching tooooo many movies. there is no end to my to-watch list and to-download list. I keep on looking on imdb and then torrent and then vlc and then again something else on imdb and so on.. and the cycle goes on. One fine day I SHOULD share the list of movies which I would definitely recommend.

> Managed to speed up my R program..which didn't help much.

> Was able to make a package in R (though its a very basic one). It took me ages to understand the required instructions which are not as bad as they appeared to be. So it was another wishful plan to end my blog's fasting days by sharing simpler set of instructions to develop a package in R.

> Looked at old problems with a new lens..and i think its helping.. or at least there is some line which has hope.. and remember hope is a good thing :)

> Gathered the courage to face the reality; if something cannot be changed, one has to deal with it. So do I.

> Got into ST-5 P. Enjoying it like anything. A friend was right, when she said, when you teach something you sideline your personal reading and studies, because every time you read, if you really do it, you keep on discovering new and new things from the same content.
..and by the by, teaching is the best job in world  :)

> Realised that my problems are much smaller than those of many people around. Its true..given a chance to exchange, I would prefer my own set.

> Too many people are interested to know about  the tracking issues with India post (or sometimes Zoomin), so much that they never let me feel low, that i am not writing and hence there are no visitors on my place :D

>>>>>>> Too sleepy now to continue.

Hope to babble more, soon  ;)