CosmoPhotoZestimator: Photometric redshift estimation from a training dataset and a...

Description Usage Arguments Value Author(s) Examples

View source: R/CosmoPhotoZestimator.R

Description

CosmoPhotoZestimator returns photometric redshift estimated from photometric data and a training dataset with photometry and spectroscopy. The estimation is based on generalized linear models (see glmTrainPhotoZ and glmPredictPhotoZ).

Usage

1
CosmoPhotoZestimator(trainData, testData, numberOfPcs, method, family, robust)

Arguments

trainData

vector containing spectroscopic redshift data and photometry (at least one column shall be called redshift)

testData

vector containing spectroscopic redshift data and photometry (at least one column shall be called redshift)

numberOfPcs

an integer indicating the number of principal components to consider

method

a string containing the chosen GLM method. Two options are available: Frequentist will use the function glm from the package stats; Bayesian will use the function bayesglm from the package arm

family

a string containing gamma or inverse.gaussian (a description of the error distribution and link function to be used in the model)

robust

a boolean indicating if robust PCA should be used or not

Value

a vector with the estimated photometric redshifts

Author(s)

Alberto Krone-Martins, Rafael S. de Souza

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# Load the data
data(PHAT0train)
data(PHAT0test)

# Run the analysis
photoZest <- CosmoPhotoZestimator(PHAT0train, PHAT0test, 6)

# Create a boxplot showing the results
plotDiagPhotoZ(photoz = photoZest, specz = PHAT0test$redshift, type = "box")

## End(Not run)

CosmoPhotoz documentation built on May 29, 2017, 3:59 p.m.