My Math Forum Transforming (Normalizing) probability data.

 Probability and Statistics Basic Probability and Statistics Math Forum

 December 8th, 2016, 11:23 AM #1 Newbie   Joined: Dec 2016 From: España Posts: 2 Thanks: 0 Transforming (Normalizing) probability data. I need some help finding a function to transform my data. I have raster files with the probability to find a certain plant species as unsigned 8 bit integers, that means: Value 0 is 0% chance to find the species, Value 255 means 100% to find the species. So far everything is right (If I want to have percentages I just have to divide). The problem comes when the cutoff (the optimun value, that represent 50% chance) is 170 (not 127). I am looking for a function to normalize the data since for each species the cutoff value is different (ranging from 40 to 230). To make my question clear, I need a function that obeys the following: 0 <- f(0) 50 <- f(cutoff) 100 <- f(255) Every other value should be transformed accordingly to the cuttoff. Thank you for trying to help!
 December 8th, 2016, 01:17 PM #2 Newbie   Joined: Dec 2016 From: España Posts: 2 Thanks: 0 I think I have done it (R code): normalize <- function (value, cutoff){ if (value == 0) { return(0) }else if (value == 255) { return (1) }else if (value == cutoff) { return (0.5) }else if (value < cutoff) { return (value*0.5/cutoff) }else if (value > cutoff) { return (1-(255-value)*0.5/(255-cutoff)) } } If someone have a more elegant answer that be great too, thanks!

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post apd2006 Advanced Statistics 1 May 29th, 2013 12:06 PM cd_gary Algebra 4 March 16th, 2012 09:49 AM swahelian Advanced Statistics 0 July 15th, 2010 02:37 PM GForce Calculus 1 February 16th, 2010 09:42 PM cd_gary Abstract Algebra 0 December 31st, 1969 04:00 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top