Hi list,

I would like to normalize a matrix (two actually for comparison) using
iterative proportional fitting.

Using ipf() would be the easiest way to do this, however I can't get my
head around the use of the function. More specifically, the margins
settings...

for a matrix:

mat <- matrix(c(65,4,22,24,6,81,5,8,0,11,85,19,4,7,3,90),4,4)

using

fit <- ipf(mat,margins=c(1,1,1,1,0,1,1,1,1))

generates a matrix with just 1's.

using


fit <- ipf(mat,margins=c(100,100,100,100,0,100,100,100,100))

gives a segmentation fault and crashes R !

so how do you define the margin values to which to sum the row and
column values in your matrix correctly?

Kind regards,
Koen

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to