harmonicfit | R Documentation |
This function fit an k-harmonic function to time series data.
harmonicfit( file, f1, nham = 4, weights = NULL, print = FALSE, remove_trend = TRUE )
file |
A matrix with two columns. The first column corresponds to the observations times, and the second column corresponds to the measures. |
f1 |
Frequency (1/Period) of the time series |
nham |
Number of harmonic components in the model |
weights |
An array with the weights of each observation |
print |
logical; if true, the summary of the harmonic fitted model will be printed. The default value is false. |
remove_trend |
logical; if true, the linear trend of time series will be removed before the the harmonic model is fitted. |
A list with the following components:
res Residuals to the harmonic fit of the time series.
t Observations times.
R2 Adjusted R-Squared.
MSE Mean Squared Error.
coef Summary of the coefficients estimated by the harmonic model.
data(clcep) f1=0.060033386 results=harmonicfit(file=clcep[,1:2],f1=f1) results$R2 results$MSE results=harmonicfit(file=clcep[,1:2],f1=f1,nham=3) results$R2 results$MSE results=harmonicfit(file=clcep[,1:2],f1=f1,weights=clcep[,3]) results$R2 results$MSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.