[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-help
Subject:    [R]  Searching for antilog function
From:       Carlos <arnobras () hotmail ! com>
Date:       2016-05-31 20:14:53
Message-ID: BLU436-SMTP1727A2BB2DBF0627C8FA469DF460 () phx ! gbl
[Download RAW message or body]

The following function can do the work as well

  antilog<-function(lx,base)
  {
  lbx<-lx/log(exp(1),base=base)
  result<-exp(lbx)
  result
  }

This solution is based on the change of base formula which states that :

log (x,base=b) = log(x,base=a)/log(b,base=a)

The original logarithm is changed into natural logarithm and then the 
exponential function is employed

The arguments are:

'lx', de logarithm we have.
'base', the base what was employed to obtain lx

For example:

log(78,10) = 1.892095

Then the antllog is

antilog(1.892095,10)

78

As expected.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic