Command Reference : Function Reference : Function Reference: F
  
Function Reference: F
 
@fact
@factlog
@fdist
@fileexist
@fill
@filledmatrix
@filledrowvector
@filledsym
@filledvector
@first
@firstsby
@floor
@folderexist
@fracdiff
@fv
@fact Factorial function.
@factlog Natural logarithm of the factorial function.
@fdist Upper tail of F-distribution.
@fileexist Check for existence of a file on disk.
@fill Vector initialized from a list of values.
@filledmatrix Matrix initialized with scalar value.
@filledrowvector Rowvector initialized with scalar value.
@filledsym Sym initialized with scalar value.
@filledvector Vector initialized with scalar value.
@first The first non-missing value in the vector or series.
@firstsby First non-missing value in a series for each specified group.
@floor Largest number less than or equal to with optional precision.
@folderexist Check for existence of a folder on disk.
@fracdiff Fractional difference of series data.
@fv Future value of annuity payments and (optional) initial lump sum receipt.
@fact
Factorial function.
Syntax: @fact(x)
x: integer
Return: number
for integer . Note that this function is subject to overflow for large .
@gamma may be used to obtain results for real valued .
Related, stable calculations for the logarithm of @fact may be obtained using @factlog.
Examples
= @fact(3)
returns 6.
Cross-references
See also @factlog.
@factlog
Natural logarithm of the factorial function.
Syntax: @factlog(x)
x: number
Return: number
for . Returns
@gammalog may be used to obtain results for real valued .
Examples
= @factlog(3)
returns 1.79175... (the natural log of 6).
Cross-references
See also @fact.
@fdist
Upper tail of F-distribution.
Syntax: @fdist(x, , )
x: number
: number,
: number,
Return: number
Computes the upper tail of the cumulative distribution integral
where
for and 0 otherwise, and is the beta function
Note that the functions allow for fractional degrees of freedom parameters and .
Examples
= @fdist(1, 2, 2)
returns 0.5.
Cross-references
See also @cfdist, @dfdist, @qfdist, and @rfdist.
@fileexist
Check for existence of a file on disk.
Syntax: @fileexist(str)
str: string
Return: integer
Check for an file’s existence. str should contain the full path and file name of the file you want to check for. Returns a “1” if the file exists, and a “0” if it does not exist.
Examples
!exists = @fileexist("myfile.prg")
checks for the existence of MYFILE.PRG in the EViews working directory.
!exists = @fileexist("c:\users\william tell\myfile.prg")
checks for the existence of MYFILE.PRG in the specified directory.
Cross-references
See also @wdir and @folderexist
@fill
Vector initialized from a list of values.
Syntax: @fill(n1[, n2, n3, ...])
n#: number
Return: vector
Returns a vector containing the elements specified by the arguments to the function. The vector will have length equal to the number of arguments. The maximum number of arguments is 96.
Examples
vector v = @fill(1, 4, 6, 21.3)
Will return a 4 element vector, where the first element is set to 1, the second to 4, the third to 6 and the fourth to 21.3.
vector pvals = @cnorm(@fill(-1.65, -1, .5, 1.76))
evaluates the cumulative normal distribution function for the vector of values {-1.65, -1.0, 0.5, 1.76}.
Cross-references
See @filledmatrix, @filledrowvector, @filledsym, and @filledvector.
See also @sfill.
@filledmatrix
Matrix initialized with scalar value.
Syntax: @filledmatrix(n1, n2, n3)
n1: integer
n2: integer
n3: number
Return: matrix
Returns a matrix with n1 rows and n2 columns, where each element contains the value n3.
Examples
= @filledmatrix(4, 3, @pi)
returns a matrix whose elements all equal to .
Cross-references
See @fill, @filledrowvector, @filledsym, and @filledvector.
@filledrowvector
Rowvector initialized with scalar value.
Syntax: @filledrowvector(n1, n2)
n1: integer
n2: integer
Return: rowvector
Returns a rowvector of length n1, where each element contains the value n2.
Examples
= @filledrowvector(3, @pi)
returns a 3-element rowvector whose elements all equal to .
Cross-references
See @fill, @filledmatrix, @filledsym, and @filledvector.
@filledsym
Sym initialized with scalar value.
Syntax: @filledsym(n1, n2)
n1: integer
n2: number
Return: sym
Returns an sym, where each element contains n2.
Examples
= @filledsym(3, @pi)
returns a sym object whose elements all equal to .
Cross-references
See @fill, @filledmatrix, @filledrowvector, and @filledvector.
@filledvector
Vector initialized with scalar value.
Syntax: @filledvector(n1, n2)
n1: integer
n2: number
Return: vector
Returns a vector of length n1, where each element contains the value n2.
Examples
= @filledvector(3, @pi)
returns a 3-element (column) vector whose elements all equal to .
Cross-references
See @fill, @filledmatrix, @filledrowvector, and @filledsym.
@first
The first non-missing value in the data object.
Syntax: @first(m)
m: numeric or alphanumeric object
Return: number or string
Returns scalar containing the first non-missing values of the single column data object. The series and alpha versions use the current workfile sample.
Examples
Let V be a vector of length 4 whose elements are NA, NA, 4.2, and 1.7. Then
= @first(v)
returns 4.2.
Cross-references
See also @cfirst, @clast, @cifirst, and @cilast.
See also @last, @ifirst, and @ilast.
@firstsby
First non-missing value in a series or alpha for each group defined by distinct values.
Syntax: @firstsby(x, y[y1, y2, ... yn, s])
x: series, alpha
y1...yn series, alpha, group
s: (optional) sample string or object
Return: number, string
First non-missing value in each distinct value group computed using the current workfile or specified sample.
Examples
show @firstsby(x, g1, g2)
produces a linked series of the by-group first non-missing values of the series x, where members of the same group have identical values for both g1 and g2.
Cross-references
See also @lastsby.
@floor
Largest integer less than or equal to (with optional precision).
Syntax: @floor(x[, n])
x: number
n: (optional) integer
Return: number
@floor(x) returns , the largest integer that is less than or equal to x.
@floor(x, n) returns , the largest decimal number that is less than or equal to x at the given precision.
The decimal offset n may be interpreted as the precision to use when computing the floor. If n is not an integer, the integer floor will be used.
Examples
= @floor(@pi)
returns 3.
= @floor(@pi,2)
returns 3.14.
= @floor(-@pi)
returns -4.
Cross-references
See also @ceil.
@folderexist
Check for existence of a folder on disk.
Syntax: @folderexist(str)
str: string
Return: integer
str should contain the full path of the folder you want to verify. Returns a “1” if the folder exists, and a “0” if it does not exist.
Examples
!exists = @folderexist("backup")
checks for the existence of the folder BACKUP in the EViews working directory.
!exists = @folderexist("c:\users\william tell\backup")
checks for the existence of BACKUP in the specified directory.
Cross-references
See also @wdir and @fileexist.
@fracdiff
Fractional difference of series data.
Syntax: @fracdiff(x, y[, s])
x: series
y: series
s: (optional) sample string or object
Return: series
Returns for series x for :
(18.6)
This function is panel aware.
Examples
show @fracdiff(@demean(x),1.5)
applies to the demeaned version of the series x.
Cross-references
See also d.
@fv
Future value of annuity payments and (optional) initial lump sum receipt.
Syntax: @fv(r, n, x[, v, bf])
r: number
n: integer
x: number
v: (optional) number
bf: (optional) number
Return: number
Compute future (negative) value of payment of an n-period annuity, with payments x and rate r, and optional receipt of (positive) initial lump sum v.
If n is not an integer, the integer floor will be used.
A non-zero value for the optional bf indicates that the payments are made at the beginning of periods (annuity due) instead of ends (ordinary annuity).
The future value of an initial lump sum followed by n-periods of ordinary annuity payments:
The future value of an initial lump sum followed by annuity due payments is:
Examples
= @fv(0.05, 10, 100, 1000)
returns the value 371.1054, meaning that the issuer of the annuity stands to profit $371.11 once payments are done.
Cross-references
See also @nper, @pmt, @pv, and @rate.