R/class-pmoments.R

#################################################################################
##
##   R package pmoments by Alexios Ghalanos Copyright (C) 2008
##   This file is part of the R package pmoments.
##
##   The R package pmoments is free software: you can redistribute it and/or modify
##   it under the terms of the GNU General Public License as published by
##   the Free Software Foundation, either version 3 of the License, or
##   (at your option) any later version.
##
##   The R package pmoments is distributed in the hope that it will be useful,
##   but WITHOUT ANY WARRANTY; without even the implied warranty of
##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##   GNU General Public License for more details.
##
#################################################################################
# Classes
setClass("PartialMoments","VIRTUAL")

#Partial Moments Expectation Class
setClass("PME",
		representation(datanames = "vector",
				standardize="vector",
				tail = "vector",
				moment = "vector",
				method = "vector",
				threshold = "vector",
				distribution = "vector",
				pm = "vector",
				data = "matrix",
				datatype ="character"),		
		contains="PartialMoments")
#Partial Co-Moments Expectation Class
setClass("PCME",
		representation(tail = "character",
				corr = "matrix",
				moment = "vector",
				pm = "matrix"),
		contains="PartialMoments")

#Partial Moments Utility Class
setClass("PMU",
		representation(data = "vector",
				threshold = "numeric",
				urc = "numeric",
				lrc = "numeric",
				lmoment = "numeric",
				umoment = "numeric",
				utility = "vector"),
		contains="PartialMoments")


#Partial Moments Solver Class
setClass("PMSOLVER",
		representation(weights = "matrix",
				riskMeasure = "vector",
				rewardMeasure = "vector",
				riskAversion = "vector",
				riskFree = "vector",
				tangent = "vector",
				moment = "numeric",
				solverMessage = "vector",
				solver = "character",
				solverType = "character",
				assetnames = "vector"),
		contains="PartialMoments")

#################################################################################
#General Constraints Class

setClass("Constraints","VIRTUAL")

setClass("userConstraints",
		representation(call = "call",
				forecasts = "vector",
				portfolioReturn = "vector",
				riskAversion = "vector",
				riskFree = "vector",
				budget = "numeric",
				group = "matrix",
				groupUB = "vector",
				groupLB = "vector",
				assetsUB = "vector",
				assetsLB = "vector"
		),
		prototype(call = call("userConstraints"),
				forecasts = numeric(0),
				portfolioReturn = numeric(0),
				riskAversion = numeric(1),
				riskFree = numeric(0),
				budget = numeric(1),
				group = matrix(0),
				groupUB = numeric(0),
				groupLB = numeric(0),
				assetsUB = numeric(0),
				assetsLB = numeric(0)),
		contains = "Constraints"
)


setClass("solverConstraints",
		representation(call = "call",
				type = "character",
				direction = "numeric",
				Aineq = "matrix",
				bineq = "vector",
				Aeq = "matrix",
				beq = "vector",
				UB = "vector",
				LB = "vector"),
		prototype(call = call("solverConstraints"),
				type = "L11",
				direction = numeric(1),
				Aineq = matrix(0),
				bineq = numeric(0),
				Aeq = matrix(0),
				beq = numeric(0),
				UB = numeric(0),
				LB = numeric(0)),
		contains = "Constraints"
)
#----------------------------------------------------------------------------------
setClass("PSRISK", 
		representation(A = "numeric",
					   b = "numeric",
					   a = "numeric",
					   h = "numeric",
					   W = "function",
				       distribution = "character",
					   fit = "vector",
					   riskMeasure="vector"))

Try the pmoments package in your browser

Any scripts or data that you put into this service are public.

pmoments documentation built on May 2, 2019, 4:42 p.m.