Created
June 11, 2013 13:46
-
-
Save tacsio/5756987 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env R - | |
#=============================================================================== | |
# | |
# FILE: moment_matching.R | |
# | |
# USAGE: R -f moment_matching.R --args [file] | |
# | |
# DESCRIPTION: Calculates moment matching of sample data | |
# | |
# OPTIONS: --- | |
# REQUIREMENTS: R libs instaled | |
# BUGS: --- | |
# AUTHOR: Marcelo Bassani - [email protected] | |
# Tarcisio Coutinho - [email protected] | |
# ORGANIZATION: UFPE (Universidade Federal de Pernambuco) - CIn (Centro de Informática) | |
# CREATED: 05/06/2013 01:31:40 AM BRT | |
# REVISION: 1.0 | |
#=============================================================================== | |
file_name <- commandArgs(TRUE) | |
setwd(".") | |
data = read.table(file_name)[,1] | |
mean = mean(data) | |
std = sd(data) | |
cov = std/mean | |
icov = 1/cov | |
if(icov == 1){ | |
#Exponencial | |
distribuition = "Exponencial" | |
} else if(icov < 1){ | |
#Hiper-Exponencial | |
distribuition = "Hiper-Exponencial" | |
} else if(icov > 1) { | |
if(icov == round(icov)){ | |
#Erlang | |
distribuition = "Erlang" | |
} else { | |
#Hipo-Exponencial | |
distribuition = "Hipo-Exponencial" | |
} | |
} | |
phases = (mean/std)^2 | |
uE = phases/mean | |
mean | |
std | |
cov | |
icov | |
distribuition | |
phases | |
uE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment