Description Usage Arguments Value Examples

View source: R/estimate_template.R

This function uses local quadratic regression to estimate the template
spectrum from a collection of observed spectra from a star as described in
Holzer et al. (2020). All observed
spectra are assumed to be normalized. The bandwidth is chosen locally through
generalized cross-validation. We **strongly** recommend using parallel
computing for this function. Therefore, the `cores`

argument has the
default value of 19.

1 2 3 4 5 6 7 8 | ```
estimate_template(
SPECTRA,
min_wvl = NULL,
max_wvl = NULL,
bandwidth_bnds = c(0.017, 0.05),
min_count = 100,
cores = 19
)
``` |

`SPECTRA` |
a list of all observed spectra to use in estimating the template. Each observed spectrum should have the format of being a list with the following names (or a dataframe with the following columns): “Wavelength" and “Flux". |

`min_wvl` |
a number that indicates the minimum wavelength for the estimated template |

`max_wvl` |
a number that indicates the maximum wavelength for the estimated template |

`bandwidth_bnds` |
a vector of length 2 that gives the interval of bandwidth values (in the same units as the wavelength of the spectra) to be considered in the generalized cross-validation |

`min_count` |
the minimum number of data points required for local regression to be done on a given wavelength chunk |

`cores` |
the number of cores to parallelize over (if set to 1, no parallelizing is done) |

a list with the following elements:

`Wavelength` |
the wavelength axis of the estimated template |

`Flux` |
the normalized flux of the estimated template |

`Chunk_bounds` |
a list of length 2 vectors that give the wavelength bounds for each chunk for which the smoothing was done on |

`Bandwidths` |
the bandwidths chosen for each of the chunks |

`Std_err` |
the standard errors of the estimated normalized flux that can be used for prediction confidence intervals |

1 2 3 4 5 6 7 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.