freg | R Documentation |
Functional linear regression model in which the response variable is a scalar variable whereas the independent variables are functional variables. Independent variables could also be scalar variables.
freg(formula, betalist = NULL)
formula |
a formula expression of the form |
betalist |
an optional argument. A list which contains beta regression coefficient functions for independent variables. If betalist is not provided, the number of estimated beta regression coefficient functions for one functional covariate would equal the number of basis functions used to represent that functional covariate. For a scalar variable, beta regression coefficient function is also a functional object whose basis is constant. Needless to say, for a scalar variable, there will be one beta regression coefficient. |
call |
call of the lfreg function |
x.count |
number of predictors |
xfdlist |
a list of functional data objects. The length of the list is equal to the number of predictors |
betalist |
a list of beta regression coefficient functions |
coefficients |
estimated beta regression coefficient functions |
library(fda) y = log10(apply(daily$precav,2,sum)) x = daily$tempav xbasis = create.fourier.basis(c(1,365),5) # 5 basis functions # smoothing of the data and extraction of functional data object xfd=smooth.basis(c(1:365),x,xbasis)$fd formula = y ~ xfd # betalist is an optional argument bbasis = create.fourier.basis(c(1,365),5) # 5 basis functions betalist = list(bbasis) freg.model = freg(formula = formula, betalist = betalist) # Functional variable and two scalar variables latitude = CanadianWeather$coordinates[,1] longitude = CanadianWeather$coordinates[,2] xfdlist = list(xfd, latitude, longitude) cbasis = create.constant.basis(c(1,365)) betalist = list(bbasis, cbasis, cbasis) formula = y ~ xfd + latitude + longitude freg.model = freg(formula = formula, betalist = betalist) print(freg.model$coefficients)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.